Spaces:
Runtime error
Runtime error
André Catarino
commited on
Commit
•
f91afe7
1
Parent(s):
59c1b0c
wip
Browse files- Dockerfile +10 -12
- app/requirements.txt +1 -0
Dockerfile
CHANGED
@@ -1,27 +1,25 @@
|
|
1 |
#FROM tiangolo/uvicorn-gunicorn:python3.9
|
2 |
FROM python:3.10.10
|
3 |
# Set up a new user named "user" with user ID 1000
|
4 |
-
|
5 |
|
6 |
# Switch to the "user" user
|
7 |
-
|
8 |
# Set home to the user's home directory
|
9 |
-
|
10 |
-
|
11 |
|
12 |
# Set the working directory to the user's home directory
|
13 |
-
|
14 |
-
WORKDIR /app
|
15 |
|
16 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
17 |
-
|
|
|
18 |
COPY ./app /app
|
|
|
19 |
|
20 |
-
ENV DASH_DEBUG_MODE False
|
21 |
-
#COPY ./app /app
|
22 |
-
#WORKDIR /app
|
23 |
RUN set -ex && \
|
24 |
pip install -r requirements.txt
|
25 |
EXPOSE 8050
|
26 |
-
|
27 |
-
|
|
|
1 |
#FROM tiangolo/uvicorn-gunicorn:python3.9
|
2 |
FROM python:3.10.10
|
3 |
# Set up a new user named "user" with user ID 1000
|
4 |
+
RUN useradd -m -u 1000 user
|
5 |
|
6 |
# Switch to the "user" user
|
7 |
+
USER user
|
8 |
# Set home to the user's home directory
|
9 |
+
ENV HOME=/home/user \
|
10 |
+
PATH=/home/user/.local/bin:$PATH
|
11 |
|
12 |
# Set the working directory to the user's home directory
|
13 |
+
WORKDIR $HOME/app
|
|
|
14 |
|
15 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
16 |
+
COPY --chown=user ./app $HOME/app
|
17 |
+
ENV DASH_DEBUG_MODE False
|
18 |
COPY ./app /app
|
19 |
+
WORKDIR /app
|
20 |
|
|
|
|
|
|
|
21 |
RUN set -ex && \
|
22 |
pip install -r requirements.txt
|
23 |
EXPOSE 8050
|
24 |
+
|
25 |
+
CMD ["gunicorn", "-b", "0.0.0.0:8050", "--reload", "app:server"]
|
app/requirements.txt
CHANGED
@@ -2,3 +2,4 @@ numpy
|
|
2 |
dash
|
3 |
dash_bootstrap_components
|
4 |
plotly
|
|
|
|
2 |
dash
|
3 |
dash_bootstrap_components
|
4 |
plotly
|
5 |
+
gunicorn
|