Support full Flask debug mode.
This commit is contained in:
parent
cd74a5cd6c
commit
377d51c2f8
3 changed files with 25 additions and 5 deletions
18
Dockerfile
18
Dockerfile
|
@ -1,14 +1,12 @@
|
||||||
###################################################################
|
###################################################################
|
||||||
# Base/release container
|
# Base container
|
||||||
FROM python:3.11 AS release
|
FROM python:3.11 AS base
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
RUN apt update && apt -y upgrade && apt install -y supervisor ffmpeg
|
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
|
WORKDIR /service
|
||||||
COPY pyproject.toml .
|
COPY pyproject.toml .
|
||||||
COPY poetry.lock .
|
COPY poetry.lock .
|
||||||
|
@ -20,6 +18,13 @@ RUN mkdir /images && mkdir /songs
|
||||||
EXPOSE 80/tcp
|
EXPOSE 80/tcp
|
||||||
|
|
||||||
ENV FLASK_APP=files/cli:app
|
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" ]
|
CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisord.conf" ]
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,6 +36,9 @@ FROM release AS dev
|
||||||
COPY thirdparty/sqlalchemy-easy-profile sqlalchemy-easy-profile
|
COPY thirdparty/sqlalchemy-easy-profile sqlalchemy-easy-profile
|
||||||
RUN cd sqlalchemy-easy-profile && python3 setup.py install
|
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)
|
# Utility container for running commands (tests, most notably)
|
||||||
|
|
12
supervisord.conf.dev
Normal file
12
supervisord.conf.dev
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue