installed sqllite3 and added an apt-update before the upgrade. Also EXPOSE/opened port 8080 (non-priv)

This commit is contained in:
2025-04-30 13:55:30 +10:00
parent 2809c01d8e
commit 50461cca4c

View File

@@ -3,13 +3,13 @@ FROM python:latest
# this forces /code to be owned by the user specified in the docker-compose file, we could ignore issues without this (but I am writing log files to the current dir with gunicorn as a non-priv'd user) # this forces /code to be owned by the user specified in the docker-compose file, we could ignore issues without this (but I am writing log files to the current dir with gunicorn as a non-priv'd user)
ARG USERID ARG USERID
ARG GROUPID ARG GROUPID
RUN apt-get dist-upgrade -y RUN apt-get update && apt-get install sqlite3 && apt-get dist-upgrade -y
WORKDIR /code WORKDIR /code
COPY requirements.txt . COPY requirements.txt .
RUN pip3 install -r requirements.txt RUN pip3 install -r requirements.txt
COPY . . COPY . .
RUN chown -R ${USERID}:${GROUPID} /code RUN chown -R ${USERID}:${GROUPID} /code
EXPOSE 80 EXPOSE 8080
CMD gunicorn --bind=0.0.0.0:80 --workers=2 --threads=2 main:app --env ENV="production" --error-logfile /code/gunicorn.error.log --access-logfile /code/gunicorn.log --capture-output CMD gunicorn --bind=0.0.0.0:8080 --workers=2 --threads=2 main:app --error-logfile /code/gunicorn.error.log --access-logfile /code/gunicorn.log --capture-output
# comment out the gunicorn line & uncomment the sleep so you can run gunicorn by hand in case it does not start on init (via docker exec...) # comment out the gunicorn line & uncomment the sleep so you can run gunicorn by hand in case it does not start on init (via docker exec...)
#CMD sleep 99999 #CMD sleep 99999