# Use an official Ubuntu image as a parent image FROM ubuntu:20.04 # Set environment variables for Python ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 # Update and install system dependencies RUN apt-get update \ && apt-get install -y nano python3-pip python3-dev postgresql-client libpq-dev cron \ && cd /usr/local/bin \ && ln -s /usr/bin/python3 python \ && pip3 --no-cache-dir install --upgrade pip \ && rm -rf /var/lib/apt/lists/* # Set the working directory in the container WORKDIR /app # Install Python dependencies COPY requirements.txt /app/ RUN pip3 install --no-cache-dir -r requirements.txt # Copy the application code into the container COPY . /app/ # Expose a port that the Django app will run on EXPOSE 8000 # Run the Django application CMD cd server-django && python3 manage.py runserver 0.0.0.0:8000