From c5cdc5d774ddefd19fc3b5530a871d4e3e214e11 Mon Sep 17 00:00:00 2001 From: saani Date: Sun, 23 Nov 2025 19:23:58 +0000 Subject: [PATCH] refactor(docker): clean up dockerfile and improve CMD syntax - Remove redundant inline comments for better readability - Replace backslash line continuation with bash -c for CMD instruction - Remove commented out gunicorn configuration line - Improve CMD formatting using proper bash string syntax These changes make the dockerfile cleaner and more maintainable while preserving the same functionality (migrate, collectstatic, runserver). --- dockerfile | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/dockerfile b/dockerfile index b45abce..453a488 100644 --- a/dockerfile +++ b/dockerfile @@ -1,33 +1,24 @@ FROM python:3.12-slim -# Environment settings ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 -# Set work directory WORKDIR /app -# System dependencies RUN apt-get update && apt-get install -y \ build-essential \ curl wget \ && rm -rf /var/lib/apt/lists/* -# Copy dependency file COPY requirements.txt . - -# Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt -# Copy project files COPY . . -# Expose port EXPOSE 8000 -# 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 +CMD bash -c " + python manage.py migrate && + python manage.py collectstatic --noinput && + python manage.py runserver 0.0.0.0:8000 +" \ No newline at end of file