Support full Flask debug mode.

This commit is contained in:
Ben Rog-Wilhelm 2022-11-19 02:49:15 -06:00 committed by Ben Rog-Wilhelm
parent cd74a5cd6c
commit 377d51c2f8
3 changed files with 25 additions and 5 deletions

View file

@ -1,14 +1,12 @@
###################################################################
# Base/release container
FROM python:3.11 AS release
# Base container
FROM python:3.11 AS base
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt -y upgrade && apt install -y supervisor ffmpeg
COPY supervisord.conf /etc/supervisord.conf
# we'll end up blowing away this directory via docker-compose
# we'll end up blowing away this directory via docker-compose
WORKDIR /service
COPY pyproject.toml .
COPY poetry.lock .
@ -20,6 +18,13 @@ RUN mkdir /images && mkdir /songs
EXPOSE 80/tcp
ENV FLASK_APP=files/cli:app
###################################################################
# Release container
FROM base AS release
COPY supervisord.conf.release /etc/supervisord.conf
CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisord.conf" ]
@ -31,6 +36,9 @@ FROM release AS dev
COPY thirdparty/sqlalchemy-easy-profile sqlalchemy-easy-profile
RUN cd sqlalchemy-easy-profile && python3 setup.py install
COPY supervisord.conf.dev /etc/supervisord.conf
CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisord.conf" ]
###################################################################
# Utility container for running commands (tests, most notably)

12
supervisord.conf.dev Normal file
View file

@ -0,0 +1,12 @@
[supervisord]
nodaemon=true
pidfile=/tmp/supervisord.pid
logfile=/tmp/supervisord.log
[program:service]
directory=/service
command=sh -c 'python3 -m flask db upgrade && WERKZEUG_DEBUG_PIN=off python3 -m flask --debug run --host=0.0.0.0 --port=80'
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0