Fix dockerfile ?
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
.venv
|
||||||
|
venv
|
||||||
|
ENV
|
||||||
|
env
|
||||||
|
.env
|
||||||
|
__pycache__
|
||||||
|
*.pyc
|
||||||
|
*.pyo
|
||||||
|
*.pyd
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
+10
-10
@@ -1,24 +1,24 @@
|
|||||||
FROM python:3.11-slim
|
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
|
WORKDIR /cloud
|
||||||
|
|
||||||
# DEBUG
|
# Copy requirements from build context root or relative path
|
||||||
# RUN apt update && apt install -y dnsutils iputils-ping
|
|
||||||
|
|
||||||
# Copy the requirements file and install dependencies
|
|
||||||
COPY cloud/requirements.txt .
|
COPY cloud/requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r 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 cloud/ .
|
||||||
COPY shared/ ./shared/
|
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
|
RUN mkdir -p storage/dishPhotos
|
||||||
|
|
||||||
# Expose the port the app will run on
|
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
# Use Gunicorn to run the application in production
|
# Call gunicorn directly
|
||||||
CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "--threads", "4", "--timeout", "300", "app:app"]
|
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "--threads", "4", "--timeout", "300", "app:app"]
|
||||||
Reference in New Issue
Block a user