Spaces:
Paused
Paused
Commit ·
1a71614
1
Parent(s): 467efa4
Update Dockerfile
Browse files- Dockerfile +8 -38
Dockerfile
CHANGED
|
@@ -1,44 +1,14 @@
|
|
| 1 |
-
|
| 2 |
-
FROM python:3.8-slim-buster
|
| 3 |
|
| 4 |
-
|
| 5 |
-
RUN useradd -m -u 1000 user
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
| 9 |
-
PATH=/home/user/.local/bin:$PATH \
|
| 10 |
-
API_ENDPOINT=$API_ENDPOINT \
|
| 11 |
-
WORKERS=$WORKERS
|
| 12 |
-
|
| 13 |
-
# Set the working directory to the user's home directory
|
| 14 |
-
WORKDIR $HOME/app
|
| 15 |
-
|
| 16 |
-
# Install necessary packages
|
| 17 |
-
RUN apt-get update \
|
| 18 |
-
&& apt-get install -y nginx \
|
| 19 |
-
&& apt-get clean
|
| 20 |
-
|
| 21 |
-
# Switch to the "user" user
|
| 22 |
-
USER user
|
| 23 |
-
|
| 24 |
-
# Upgrade pip
|
| 25 |
-
RUN pip install --no-cache-dir --upgrade pip
|
| 26 |
-
|
| 27 |
-
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 28 |
-
COPY --chown=user . $HOME/app
|
| 29 |
-
|
| 30 |
-
# Install any needed packages specified in requirements.txt
|
| 31 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 32 |
|
| 33 |
-
#
|
| 34 |
-
|
| 35 |
-
RUN rm /etc/nginx/sites-enabled/default
|
| 36 |
-
COPY --chown=user nginx.conf /etc/nginx/sites-available/
|
| 37 |
-
RUN ln -s /etc/nginx/sites-available/nginx.conf /etc/nginx/sites-enabled/
|
| 38 |
-
USER user
|
| 39 |
|
| 40 |
-
|
| 41 |
-
EXPOSE 7680
|
| 42 |
|
| 43 |
-
|
| 44 |
-
CMD service nginx start && python app.py
|
|
|
|
| 1 |
+
FROM python:3.9-slim-buster
|
|
|
|
| 2 |
|
| 3 |
+
WORKDIR /app
|
|
|
|
| 4 |
|
| 5 |
+
# Install dependencies
|
| 6 |
+
COPY requirements.txt .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 8 |
|
| 9 |
+
# Copy the source code
|
| 10 |
+
COPY app.py .
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
EXPOSE 5000
|
|
|
|
| 13 |
|
| 14 |
+
CMD [ "python", "app.py" ]
|
|
|