Spaces:
Running
Running
alanchen1115
commited on
Commit
•
76f415c
1
Parent(s):
583613c
Update Dockerfile
Browse files- Dockerfile +6 -25
Dockerfile
CHANGED
@@ -1,32 +1,13 @@
|
|
1 |
-
# Use the official Python base image
|
2 |
FROM python:3.9
|
3 |
|
4 |
-
|
5 |
-
WORKDIR /app
|
6 |
|
7 |
-
|
8 |
-
COPY requirements.txt .
|
9 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
10 |
|
11 |
-
|
12 |
-
RUN useradd -m -u 1000 user
|
13 |
-
# Switch to the "user" user
|
14 |
-
USER user
|
15 |
-
# Set home to the user's home directory
|
16 |
-
ENV HOME=/home/user \
|
17 |
-
PATH=/home/user/.local/bin:$PATH
|
18 |
|
19 |
-
|
20 |
-
WORKDIR $HOME/app
|
21 |
|
22 |
-
#
|
23 |
-
COPY --chown=user . $HOME/app
|
24 |
|
25 |
-
|
26 |
-
EXPOSE 5000
|
27 |
-
|
28 |
-
# Set the environment variable for Flask
|
29 |
-
ENV FLASK_APP=api_server.py
|
30 |
-
|
31 |
-
# Run the Flask application
|
32 |
-
CMD ["flask", "run", "--host=0.0.0.0"]
|
|
|
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
+
WORKDIR /code
|
|
|
4 |
|
5 |
+
COPY ./requirements.txt /code/requirements.txt
|
|
|
|
|
6 |
|
7 |
+
RUN pip install --no-cache-dir -r /code/requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
+
COPY . .
|
|
|
10 |
|
11 |
+
# CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
12 |
|
13 |
+
CMD python app.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|