Hana444 commited on
Commit
a0eb7f9
·
verified ·
1 Parent(s): 472a699

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -20
Dockerfile CHANGED
@@ -1,26 +1,18 @@
1
- # Use official Python 3.11 slim image
2
- FROM python:3.11-slim
3
 
4
- # Set environment variables
5
- ENV PYTHONUNBUFFERED=1 \
6
- PORT=7860 \
7
- DASH_DEBUG_MODE=0
8
 
9
- # Set working directory
10
- WORKDIR /app
11
-
12
- # Copy requirements first for caching
13
- COPY requirements.txt .
14
 
15
  # Install dependencies
16
- RUN pip install --no-cache-dir --upgrade pip \
17
- && pip install --no-cache-dir -r requirements.txt
18
-
19
- # Copy all project files
20
- COPY . .
21
 
22
- # Expose the port your app will run on
23
- EXPOSE 7860
24
 
25
- # Command to run the Dash app with gunicorn
26
- CMD ["gunicorn", "app:server", "--bind", "0.0.0.0:7860", "--workers", "1"]
 
 
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"]