alternative-backend-service/dockerfile

34 lines
719 B
Plaintext
Raw Normal View History

FROM python:3.12-slim
2025-11-22 19:13:34 +00:00
# Environment settings
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
2025-11-22 19:13:34 +00:00
# Set work directory
WORKDIR /app
# System dependencies
2025-11-22 19:13:34 +00:00
RUN apt-get update && apt-get install -y \
build-essential \
curl wget \
2025-11-22 19:13:34 +00:00
&& rm -rf /var/lib/apt/lists/*
# Copy dependency file
COPY requirements.txt .
2025-11-22 19:13:34 +00:00
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy project files
2025-11-22 19:13:34 +00:00
COPY . .
# Expose port
EXPOSE 8000
2025-11-22 19:13:34 +00:00
# Run migrations + collectstatic + gunicorn at runtime
CMD \
python manage.py migrate && \
python manage.py collectstatic --noinput && \
python manage.py runserver 0.0.0.0:8000 && \
# gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 3