From 8d339ea70b1a65acc9d9efc18bdf8330a866d734 Mon Sep 17 00:00:00 2001 From: Shyanukant Rathi <72182251+shyanukant@users.noreply.github.com> Date: Mon, 2 Oct 2023 08:43:16 +0000 Subject: [PATCH] update dockerfile --- Dockerfile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 68538533..7c4fe938 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,26 @@ +# Use the official Python image as the base image FROM python:3.10 +# Set the working directory WORKDIR /app -COPY requirements.txt . +# Create a virtual environment +RUN python -m venv venv -RUN pip install --no-cache-dir virtualenv -RUN virtualenv venv +# Activate the virtual environment +SHELL ["venv/bin/activate"] -ENV PATH="/app/venv/bin:$PATH" +# Update pip to the latest version +RUN pip install --no-cache-dir --upgrade pip +# Copy the requirements file and install dependencies +COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt +# Copy the rest of your Django application code COPY . . +# Start your Django application as usual EXPOSE $PORT CMD gunicorn squib.wsgi:application --workers=4 --bind 0.0.0.0:$PORT \ No newline at end of file