nciso commited on
Commit
4b6bd51
·
verified ·
1 Parent(s): 0ad8461

Upload Dockerfile with huggingface_hub

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