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