FROM python:3.10-alpine # Change the working directory to the project root WORKDIR /srv/flask_app # Install dependencies RUN apk add nginx build-base libffi-dev curl uwsgi # Install python dependencies COPY api/requirements.txt /srv/flask_app/ RUN pip install -r requirements.txt --src /usr/local/src --no-warn-script-location # Copy the app COPY api /srv/flask_app COPY api/deploy/nginx.conf /etc/nginx # Change file permissions RUN chmod +x ./deploy/start.sh RUN chmod +x ./deploy/healthcheck.sh # Set healthcheck HEALTHCHECK --interval=15s --timeout=2s CMD ["./deploy/healthcheck.sh"] # Expose webserver port EXPOSE 80 # Run the app CMD ["./deploy/start.sh"]