From 472461b8b190f7e1b428cba37f5a4f0792a775c8 Mon Sep 17 00:00:00 2001 From: saani Date: Sat, 22 Nov 2025 19:13:34 +0000 Subject: [PATCH] Rendering with docker --- Nixpacks.toml | 13 ------------- dockerfile | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 13 deletions(-) delete mode 100644 Nixpacks.toml create mode 100644 dockerfile diff --git a/Nixpacks.toml b/Nixpacks.toml deleted file mode 100644 index e422b39..0000000 --- a/Nixpacks.toml +++ /dev/null @@ -1,13 +0,0 @@ -[phases.setup] -cmds = [ - "pip install -r requirements.txt", -] - -[phases.build] -cmds = [ - "python manage.py collectstatic --noinput", - "python manage.py migrate", -] - -[start] -cmd = "gunicorn booking_system.wsgi:application --bind 0.0.0.0:$PORT" \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..6ffeffd --- /dev/null +++ b/dockerfile @@ -0,0 +1,30 @@ +FROM python:3.11-slim + +# 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 \ + gcc \ + && rm -rf /var/lib/apt/lists/* + +# Copy requirements and install Python dependencies +COPY requirements.txt . +RUN pip install --no-cache-dir --upgrade pip +RUN pip install --no-cache-dir -r requirements.txt + +# Copy project +COPY . . + +# Collect static files +RUN python manage.py collectstatic --noinput + +# Expose port +EXPOSE 8000 + +# Run migrations and start Gunicorn +CMD sh -c "python manage.py migrate && gunicorn booking_system.wsgi:application --bind 0.0.0.0:8000 --workers 3" \ No newline at end of file -- 2.39.5