# We Use an official Python runtime as a parent image FROM python:3.11.7-bullseye # install db libs RUN apt-get update RUN apt-get install -y default-mysql-client libmariadb-dev RUN apt-get install -y libmariadb-dev-compat gcc gdal-bin libjpeg-dev # install nginx and supervisor RUN apt-get install -y --no-install-recommends \ nginx supervisor RUN useradd --no-create-home nginx # install uwsgi RUN pip3 install uwsgi # adjustments RUN rm /etc/nginx/sites-enabled/default RUN rm -r /root/.cache # production conf files COPY deploy/django-site.conf /etc/nginx/conf.d/ COPY deploy/uwsgi.ini /etc/uwsgi/ COPY deploy/supervisord.conf /etc/ # install app libs COPY requirements.txt requirements.txt RUN pip3 install --no-cache-dir -r requirements.txt # Mounts the application code to the image COPY . code # establish workdir WORKDIR /code EXPOSE 80 # runs the development server CMD ["/usr/bin/supervisord"]