sikeaditya commited on
Commit
3a91977
·
verified ·
1 Parent(s): 6c4af46

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -35
Dockerfile CHANGED
@@ -1,42 +1,19 @@
 
1
  FROM python:3.9-slim
2
 
3
- WORKDIR /code
 
4
 
5
- # Install system dependencies
6
- RUN apt-get update && \
7
- apt-get install -y --no-install-recommends \
8
- build-essential \
9
- curl \
10
- libhdf5-dev \
11
- && rm -rf /var/lib/apt/lists/*
12
 
 
 
13
 
14
- # Copy requirements first to leverage Docker cache
15
- COPY requirements.txt .
16
-
17
- # Clean pip cache and install requirements with specific versions
18
- RUN pip cache purge && \
19
- pip install --no-cache-dir -r requirements.txt
20
-
21
- # Copy project structure
22
- COPY app.py .
23
- COPY templates/ ./templates/
24
-
25
-
26
- # Set environment variables
27
- ENV PORT=7860
28
- ENV HOST=0.0.0.0
29
- ENV FLASK_APP=app.py
30
- ENV FLASK_ENV=production
31
- ENV FLASK_DEBUG=0
32
-
33
-
34
-
35
- # Create cache directory for tensorflow-hub
36
- RUN mkdir -p /root/.cache/tensorflow-hub
37
-
38
- # Expose the port
39
  EXPOSE 7860
40
 
41
- # Run Flask application with proper host and port
42
- CMD ["python", "-c", "from app import app; app.run(host='0.0.0.0', port=7860, debug=False)"]
 
1
+ # Use an official lightweight Python image
2
  FROM python:3.9-slim
3
 
4
+ # Set the working directory
5
+ WORKDIR /app
6
 
7
+ # Copy only necessary files
8
+ COPY requirements.txt ./
9
+ COPY app.py ./
10
+ COPY final_price_data.csv ./
 
 
 
11
 
12
+ # Install dependencies
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Expose the port your app runs on
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  EXPOSE 7860
17
 
18
+ # Set the command to run your application
19
+ CMD ["python", "app.py"]