28 lines
771 B
Docker
28 lines
771 B
Docker
# Use an official Python runtime as a base image
|
|
FROM python:3.13.5-slim-bookworm
|
|
|
|
# Set environment variables
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
# Set work directory
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && \
|
|
apt-get install -y build-essential libpq-dev && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Python dependencies
|
|
COPY requirements.txt /app/
|
|
RUN pip install --upgrade pip && pip install -r requirements.txt
|
|
|
|
# Copy project
|
|
COPY ./freekake_api /app/
|
|
|
|
# Run migrations & collect static in production (optional)
|
|
# CMD ["python", "manage.py", "migrate"] && ["python", "manage.py", "collectstatic", "--noinput"]
|
|
|
|
# Command to run the server
|
|
# CMD ["gunicorn", "freekake_api.wsgi:application", "--bind", "0.0.0.0:8000"]
|