Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -28
Dockerfile
CHANGED
@@ -1,36 +1,18 @@
|
|
|
|
1 |
FROM python:3.9-slim
|
2 |
|
|
|
3 |
WORKDIR /app
|
|
|
|
|
|
|
|
|
4 |
|
5 |
-
#
|
6 |
-
RUN mkdir -p /app/static/audio
|
7 |
-
RUN mkdir -p /app/templates
|
8 |
-
|
9 |
-
# Set permissions
|
10 |
-
RUN chmod -R 777 /app/static
|
11 |
-
|
12 |
-
# Install system dependencies
|
13 |
-
RUN apt-get update && \
|
14 |
-
apt-get install -y --no-install-recommends \
|
15 |
-
espeak \
|
16 |
-
libespeak1 \
|
17 |
-
&& rm -rf /var/lib/apt/lists/*
|
18 |
-
|
19 |
-
# Copy files
|
20 |
-
COPY requirements.txt .
|
21 |
-
COPY app.py .
|
22 |
-
COPY final_price_data.csv .
|
23 |
-
COPY static /app/static/
|
24 |
-
COPY templates /app/templates/
|
25 |
-
|
26 |
-
# Install Python dependencies
|
27 |
RUN pip install --no-cache-dir -r requirements.txt
|
28 |
|
29 |
-
#
|
30 |
EXPOSE 7860
|
31 |
|
32 |
-
#
|
33 |
-
|
34 |
-
|
35 |
-
# Using gunicorn as the WSGI server can be more reliable
|
36 |
-
CMD ["python", "-m", "flask", "run", "--host=0.0.0.0", "--port=7860"]
|
|
|
1 |
+
# Base image
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
+
# Set the working directory
|
5 |
WORKDIR /app
|
6 |
+
RUN mkdir -p /code/static/audio && \
|
7 |
+
chmod 777 /code/static/audio
|
8 |
+
# Copy application files
|
9 |
+
COPY . /app
|
10 |
|
11 |
+
# Install dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
RUN pip install --no-cache-dir -r requirements.txt
|
13 |
|
14 |
+
# Expose the port your app runs on
|
15 |
EXPOSE 7860
|
16 |
|
17 |
+
# Command to run the application
|
18 |
+
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]
|
|
|
|
|
|