24 lines
613 B
Docker
24 lines
613 B
Docker
# Use an official lightweight Python image.
|
|
FROM python:3.9-slim
|
|
|
|
# Set environment variables to disable bytecode generation and enable stdout/stderr logging.
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# Set the working directory.
|
|
WORKDIR /app
|
|
|
|
# Copy the requirements file and install dependencies.
|
|
COPY requirements.txt .
|
|
RUN pip install --upgrade pip && \
|
|
pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the rest of the application code.
|
|
COPY . .
|
|
|
|
# Expose the port the app runs on.
|
|
EXPOSE 9775
|
|
|
|
# Use gunicorn to serve the app.
|
|
CMD ["gunicorn", "--bind", "0.0.0.0:9775", "app_main:app"]
|