File size: 948 Bytes
669ff2c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# syntax=docker/dockerfile:1.4
FROM python:3.10-slim

# Set working directory
WORKDIR /app

# Install necessary dependencies
RUN apt-get update && apt-get install -y git

# Upgrade pip to the latest version
RUN pip install --upgrade pip

# Set Matplotlib configuration directory
ENV MPLCONFIGDIR=/tmp/.matplotlib

# Create necessary directories and set permissions
RUN mkdir -p /app /tmp/.matplotlib && chmod -R 777 /app /tmp/.matplotlib

# Clone private repository using mounted secret
RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
    git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/leoncool23/sci_logicreg_classify.git .

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Expose the port for Streamlit
EXPOSE 7860

# Run the Streamlit app
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]