19 lines
490 B
Docker
19 lines
490 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /src
|
|
|
|
# Install dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the entire project
|
|
COPY . ./app/
|
|
|
|
# Expose Gunicorn port
|
|
EXPOSE 8000
|
|
|
|
# Gunicorn command for a package structure
|
|
# "app:create_app()" assumes you have a factory function in __init__.py
|
|
# If your Flask instance is just named 'app' inside __init__.py, use "app:app"
|
|
CMD ["gunicorn", "--preload", "-w", "4", "-b", "0.0.0.0:8000", "app:create_app()"]
|