From 2c66a24e9d0cfb97a49ae5a8a2a11d28b75ee33a Mon Sep 17 00:00:00 2001 From: Matthias Guillitte Date: Mon, 27 Jul 2026 17:24:11 +0200 Subject: [PATCH] Fix dockerfile ? --- cloud/.dockerignore | 11 +++++++++++ cloud/Dockerfile | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 cloud/.dockerignore diff --git a/cloud/.dockerignore b/cloud/.dockerignore new file mode 100644 index 0000000..3687bb5 --- /dev/null +++ b/cloud/.dockerignore @@ -0,0 +1,11 @@ +.venv +venv +ENV +env +.env +__pycache__ +*.pyc +*.pyo +*.pyd +.git +.gitignore \ No newline at end of file diff --git a/cloud/Dockerfile b/cloud/Dockerfile index df84b63..f379e82 100644 --- a/cloud/Dockerfile +++ b/cloud/Dockerfile @@ -1,24 +1,24 @@ FROM python:3.11-slim -# Set the working directory inside the container +# Prevent Python from writing .pyc files and buffer stdout/stderr +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 +ENV PYTHONPATH=/cloud + WORKDIR /cloud -# DEBUG -# RUN apt update && apt install -y dnsutils iputils-ping - -# Copy the requirements file and install dependencies +# Copy requirements from build context root or relative path COPY cloud/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt -# Copy the rest of the application code +# Copy application source code COPY cloud/ . COPY shared/ ./shared/ -# Ensure the photo storage directory exists so the app doesn't crash on startup +# Create photo storage directory RUN mkdir -p storage/dishPhotos -# Expose the port the app will run on EXPOSE 5000 -# Use Gunicorn to run the application in production -CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "--threads", "4", "--timeout", "300", "app:app"] \ No newline at end of file +# Call gunicorn directly +CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "--threads", "4", "--timeout", "300", "app:app"] \ No newline at end of file