snapliran commited on
Commit
3bea548
·
verified ·
1 Parent(s): 198e91f

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ######################## WRITE YOUR DOCKERFILE SCRIPT HERE #########################
3
+
4
+ # Fill in the base image with the correct Python version (e.g., python:3.9)
5
+ FROM python:3.9
6
+
7
+ # Fill in the username to be created (e.g., user)
8
+ RUN useradd -m -u 1000 user
9
+
10
+ # Blank #3: Specify the username for subsequent commands (e.g., user)
11
+ USER user
12
+
13
+ # Fill in the username in the PATH environment variable (e.g., user)
14
+ ENV PATH="/home/user/.local/bin:$PATH"
15
+
16
+ # Set working directory
17
+ WORKDIR /app
18
+
19
+ # Use the same username for file ownership when copying requirements (e.g., user)
20
+ COPY --chown=user ./requirements.txt requirements.txt
21
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
22
+
23
+ # Use the same username for file ownership when copying the app files (e.g., user)
24
+ COPY --chown=user . /app
25
+
26
+ # Start the Streamlit app on port 7860, the default port expected by Spaces
27
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
28
+
29
+ # Reference: https://huggingface.co/docs/hub/en/spaces-sdks-docker