Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +5 -4
Dockerfile
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
# Use an official Python runtime as a parent image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
# Set environment variables for Python
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE 1
|
| 6 |
ENV PYTHONUNBUFFERED 1
|
|
|
|
| 7 |
|
| 8 |
# Set the working directory inside the container
|
| 9 |
WORKDIR /app
|
|
@@ -23,9 +24,9 @@ COPY requirements.txt /app/
|
|
| 23 |
# Install the dependencies specified in requirements.txt
|
| 24 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
|
| 26 |
-
# Create
|
| 27 |
-
RUN mkdir -p /app/uploads /app/static/uploads /app/static/results /tmp/flask_sessions /app/flask_sessions && \
|
| 28 |
-
chmod -R 777 /app/uploads /app/static/uploads /app/static/results /tmp/flask_sessions /app/flask_sessions
|
| 29 |
|
| 30 |
# Copy the entire application code to /app
|
| 31 |
COPY . /app/
|
|
|
|
| 1 |
# Use an official Python runtime as a parent image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Set environment variables for Python and Matplotlib
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE 1
|
| 6 |
ENV PYTHONUNBUFFERED 1
|
| 7 |
+
ENV MPLCONFIGDIR=/app/.config/matplotlib
|
| 8 |
|
| 9 |
# Set the working directory inside the container
|
| 10 |
WORKDIR /app
|
|
|
|
| 24 |
# Install the dependencies specified in requirements.txt
|
| 25 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 26 |
|
| 27 |
+
# Create necessary directories and set proper permissions
|
| 28 |
+
RUN mkdir -p /app/uploads /app/static/uploads /app/static/results /tmp/flask_sessions /app/flask_sessions /app/models /app/.config/matplotlib && \
|
| 29 |
+
chmod -R 777 /app/uploads /app/static/uploads /app/static/results /tmp/flask_sessions /app/flask_sessions /app/models /app/.config/matplotlib
|
| 30 |
|
| 31 |
# Copy the entire application code to /app
|
| 32 |
COPY . /app/
|