leonsimon23 commited on
Commit
eaafec3
·
verified ·
1 Parent(s): 4a65622

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # syntax=docker/dockerfile:1.4
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install necessary dependencies
8
+ RUN apt-get update && apt-get install -y git
9
+
10
+ # Upgrade pip to the latest version
11
+ RUN pip install --upgrade pip
12
+
13
+ # Set Matplotlib configuration directory
14
+ ENV MPLCONFIGDIR=/tmp/.matplotlib
15
+
16
+ # Create necessary directories and set permissions
17
+ RUN mkdir -p /app /tmp/.matplotlib && chmod -R 777 /app /tmp/.matplotlib
18
+
19
+ # Clone private repository using mounted secret
20
+ RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
21
+ git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/leoncool23/sci_lasson_classify.git .
22
+
23
+ # Install Python dependencies
24
+ RUN pip install --no-cache-dir -r requirements.txt
25
+
26
+ # Expose the port for Streamlit
27
+ EXPOSE 7860
28
+
29
+ # Run the Streamlit app
30
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]