Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +12 -20
Dockerfile
CHANGED
|
@@ -1,26 +1,18 @@
|
|
| 1 |
-
# Use
|
| 2 |
-
FROM python:3.
|
| 3 |
|
| 4 |
-
# Set
|
| 5 |
-
|
| 6 |
-
PORT=7860 \
|
| 7 |
-
DASH_DEBUG_MODE=0
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
# Copy requirements first for caching
|
| 13 |
-
COPY requirements.txt .
|
| 14 |
|
| 15 |
# Install dependencies
|
| 16 |
-
RUN pip install --no-cache-dir --upgrade
|
| 17 |
-
&& pip install --no-cache-dir -r requirements.txt
|
| 18 |
-
|
| 19 |
-
# Copy all project files
|
| 20 |
-
COPY . .
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
| 24 |
|
| 25 |
-
#
|
| 26 |
-
|
|
|
|
|
|
| 1 |
+
# Use Python image
|
| 2 |
+
FROM python:3.9
|
| 3 |
|
| 4 |
+
# Set the working directory inside the container
|
| 5 |
+
WORKDIR /code
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
# Copy the requirements file from the root
|
| 8 |
+
COPY ./requirements.txt /code/requirements.txt
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# Install dependencies
|
| 11 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
+
# Copy all files and folders (including 'pages' and 'assets')
|
| 14 |
+
COPY . /code
|
| 15 |
|
| 16 |
+
# Start the app using Gunicorn on port 7860
|
| 17 |
+
# This assumes your main file is 'app.py' and it contains 'server = app.server'
|
| 18 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:server"]
|