Files
lms-backend/Dockerfile
T
2026-04-26 05:22:02 +07:00

53 lines
1.2 KiB
Docker

# =========================
# Base Image
# =========================
FROM python:3.12-slim
# =========================
# Environment Variables
# =========================
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# =========================
# System Dependencies
# =========================
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
# =========================
# Working Directory
# =========================
WORKDIR /app
# =========================
# Python Dependencies
# =========================
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# =========================
# Copy Project Files
# =========================
COPY . .
# =========================
# Collect Static Files
# =========================
RUN python manage.py collectstatic --noinput
# =========================
# Expose Application Port
# =========================
EXPOSE 8000
# =========================
# Run Application
# =========================
CMD ["gunicorn", "core.wsgi:application", \
"--bind", "0.0.0.0:8000", \
"--workers", "3", \
"--timeout", "120"]