Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +15 -15
Dockerfile
CHANGED
|
@@ -1,22 +1,22 @@
|
|
| 1 |
-
# Use an official Python runtime as a
|
| 2 |
-
FROM python:3.
|
| 3 |
|
| 4 |
# Set the working directory in the container
|
| 5 |
-
WORKDIR /
|
| 6 |
|
| 7 |
-
# Copy the current directory contents into the container
|
| 8 |
-
COPY .
|
| 9 |
|
| 10 |
# Install any needed packages specified in requirements.txt
|
| 11 |
-
|
|
|
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
EXPOSE 8080
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
CMD gunicorn -b :8000 app:app & http-server ./static -p 8080
|
|
|
|
| 1 |
+
# Use an official Python runtime as a base image
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
|
| 4 |
# Set the working directory in the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy the current directory contents into the container
|
| 8 |
+
COPY . /app
|
| 9 |
|
| 10 |
# Install any needed packages specified in requirements.txt
|
| 11 |
+
COPY requirements.txt /app/
|
| 12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
+
# Make port 8000 available to the world outside this container
|
| 15 |
+
EXPOSE 8080
|
| 16 |
|
| 17 |
+
# Define environment variable
|
| 18 |
+
ENV UVICORN_HOST=0.0.0.0
|
| 19 |
+
ENV UVICORN_PORT=8000
|
| 20 |
+
|
| 21 |
+
# Run the application
|
| 22 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
|
|
|