fixed Dockerfile - I only needed to expose 443, not sure what I was thinking mashing this web code with DB, anyway... also switched to using env var rather than hostname to pick up DEV/PROD, and now show that in base.html. Updated Dockerfile and requirements to prep for putting ldap/auth in, will need to copy some stuff from PA later. finally removed console debugs in book.html
This commit is contained in:
19
Dockerfile
19
Dockerfile
@@ -1,8 +1,23 @@
|
||||
FROM ubuntu:20.04
|
||||
WORKDIR /code
|
||||
RUN apt-get update && apt-get -y install python3-pip python3-psycopg2 libpq-dev gunicorn
|
||||
USER root
|
||||
ENV PJM_UID=500
|
||||
ENV PJM_GID=500
|
||||
RUN groupadd -g ${PJM_GID} mythtv && useradd -r -u ${PJM_UID} -g ${PJM_GID} mythtv
|
||||
ENV TZ=Australia/Melbourne
|
||||
RUN truncate -s0 /tmp/preseed.cfg && \
|
||||
(echo "tzdata tzdata/Areas select Australia" >> /tmp/preseed.cfg) && \
|
||||
(echo "tzdata tzdata/Zones/Australia select Melbourne" >> /tmp/preseed.cfg) && \
|
||||
debconf-set-selections /tmp/preseed.cfg && \
|
||||
rm -f /etc/timezone /etc/localtime && \
|
||||
apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
|
||||
apt-get install -y tzdata
|
||||
## cleanup of files from setup
|
||||
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
RUN apt-get update && apt-get -y install python3-pip python3-psycopg2 libpq-dev gunicorn python3-ldap
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN pip3 install -r requirements.txt
|
||||
EXPOSE 443
|
||||
COPY . .
|
||||
CMD ["gunicorn", "--bind=0.0.0.0:443", "--workers=2","--threads=2", "--certfile", "/etc/letsencrypt/live/book.depaoli.id.au/fullchain.pem", "--keyfile", "/etc/letsencrypt/live/book.depaoli.id.au/privkey.pem","main:app"]
|
||||
CMD gunicorn --bind=0.0.0.0:443 --workers=2 --threads=2 --certfile /etc/letsencrypt/live/book.depaoli.id.au/fullchain.pem --keyfile /etc/letsencrypt/live/book.depaoli.id.au/privkey.pem main:app --env FLASK_ENV="production" --error-logfile gunicorn.error.log --access-logfile gunicorn.log --capture-output
|
||||
|
||||
Reference in New Issue
Block a user