Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +12 -35
Dockerfile
CHANGED
@@ -1,42 +1,19 @@
|
|
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
-
|
|
|
4 |
|
5 |
-
#
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
curl \
|
10 |
-
libhdf5-dev \
|
11 |
-
&& rm -rf /var/lib/apt/lists/*
|
12 |
|
|
|
|
|
13 |
|
14 |
-
#
|
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 |
-
#
|
42 |
-
CMD ["python", "
|
|
|
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"]
|