FROM python:3.9-slim WORKDIR /code COPY ./requirements.txt /code/requirements.txt RUN pip install --no-cache-dir -r requirements.txt COPY . /code/ run mkdir -p /var/lib/nginx && chmod 777 /var/lib/nginx run mkdir -p /var/log && chmod 777 /var/log RUN mkdir -p /etc/nginx && mkdir -p /var/run && chmod 777 -R /var && chmod 777 -R /etc/nginx && chmod 777 -R /var/run run mkdir -p /var/log/nginx run touch /var/log/nginx/access.log && chmod 777 /var/log/nginx/access.log run chmod 777 /var/log/nginx RUN apt update && \ apt install -y nginx CMD nginx -c /code/nginx.conf &&python app.py