mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-24 09:38:35 +02:00
@@ -3,13 +3,13 @@ volumes:
|
|||||||
wygiwyh_temp:
|
wygiwyh_temp:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
web: &django
|
web:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./docker/dev/django/Dockerfile
|
dockerfile: ./docker/dev/django/Dockerfile
|
||||||
image: wygiwyh_dev_server
|
image: wygiwyh_dev_server
|
||||||
container_name: wygiwyh_dev_server
|
container_name: wygiwyh_dev_server
|
||||||
command: /start
|
command: /start-supervisor
|
||||||
volumes:
|
volumes:
|
||||||
- ./app/:/usr/src/app/:z
|
- ./app/:/usr/src/app/:z
|
||||||
- ./frontend/:/usr/src/frontend:z
|
- ./frontend/:/usr/src/frontend:z
|
||||||
@@ -54,12 +54,12 @@ services:
|
|||||||
- '${SQL_PORT}:5432'
|
- '${SQL_PORT}:5432'
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
procrastinate:
|
# procrastinate:
|
||||||
<<: *django
|
# <<: *django
|
||||||
image: wygiwyh_dev_procrastinate
|
# image: wygiwyh_dev_procrastinate
|
||||||
container_name: wygiwyh_dev_procrastinate
|
# container_name: wygiwyh_dev_procrastinate
|
||||||
depends_on:
|
# depends_on:
|
||||||
- db
|
# - db
|
||||||
ports: [ ]
|
# ports: [ ]
|
||||||
command: /start-procrastinate
|
# command: /start-procrastinate
|
||||||
restart: unless-stopped
|
# restart: unless-stopped
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
|
|||||||
COPY --from=python-build-stage /usr/src/app/wheels /wheels/
|
COPY --from=python-build-stage /usr/src/app/wheels /wheels/
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install --no-install-recommends -y gettext && \
|
apt-get install --no-install-recommends -y gettext supervisor && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
pip install --upgrade pip && \
|
pip install --upgrade pip && \
|
||||||
pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* && \
|
pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* && \
|
||||||
@@ -26,9 +26,15 @@ RUN apt-get update && \
|
|||||||
|
|
||||||
COPY ./docker/dev/django/start /start
|
COPY ./docker/dev/django/start /start
|
||||||
COPY ./docker/dev/procrastinate/start /start-procrastinate
|
COPY ./docker/dev/procrastinate/start /start-procrastinate
|
||||||
|
COPY ./docker/dev/supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
COPY ./docker/dev/supervisord/supervisord.conf /etc/supervisord.conf
|
||||||
|
COPY ./docker/dev/supervisord/start /start-supervisor
|
||||||
|
|
||||||
RUN sed -i 's/\r$//g' /start && \
|
RUN sed -i 's/\r$//g' /start && \
|
||||||
chmod +x /start && \
|
chmod +x /start && \
|
||||||
sed -i 's/\r$//g' /start-procrastinate && \
|
sed -i 's/\r$//g' /start-procrastinate && \
|
||||||
chmod +x /start-procrastinate
|
chmod +x /start-procrastinate && \
|
||||||
|
sed -i 's/\r$//g' /start-supervisor && \
|
||||||
|
chmod +x /start-supervisor
|
||||||
|
|
||||||
COPY ./app .
|
COPY ./app .
|
||||||
|
|||||||
9
docker/dev/supervisord/start
Normal file
9
docker/dev/supervisord/start
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
set -o pipefail
|
||||||
|
set -o nounset
|
||||||
|
|
||||||
|
export TASK_WORKERS=${TASK_WORKERS:=1}
|
||||||
|
|
||||||
|
exec supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
||||||
39
docker/dev/supervisord/supervisord.conf
Normal file
39
docker/dev/supervisord/supervisord.conf
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
logfile=/dev/null
|
||||||
|
logfile_maxbytes=0
|
||||||
|
pidfile=/tmp/supervisord.pid
|
||||||
|
user=root
|
||||||
|
|
||||||
|
[supervisorctl]
|
||||||
|
serverurl=unix:///run/supervisord.sock
|
||||||
|
|
||||||
|
[rpcinterface:supervisor]
|
||||||
|
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||||
|
|
||||||
|
[unix_http_server]
|
||||||
|
file=/run/supervisord.sock
|
||||||
|
chmod=0700
|
||||||
|
|
||||||
|
[program:web]
|
||||||
|
directory=/usr/src/app
|
||||||
|
command=/bin/bash /start
|
||||||
|
stdout_logfile=/dev/fd/1
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/fd/2
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
autorestart=true
|
||||||
|
startretries=5
|
||||||
|
|
||||||
|
[program:procrastinate]
|
||||||
|
directory=/usr/src/app
|
||||||
|
command=/bin/bash /start-procrastinate
|
||||||
|
process_name=%(program_name)s_%(process_num)02d
|
||||||
|
numprocs=%(ENV_TASK_WORKERS)s
|
||||||
|
numprocs_start=1
|
||||||
|
stdout_logfile=/dev/fd/1
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/fd/2
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
autorestart=true
|
||||||
|
startretries=5
|
||||||
@@ -31,7 +31,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
|
|||||||
COPY --from=python-build-stage /usr/src/app/wheels /wheels/
|
COPY --from=python-build-stage /usr/src/app/wheels /wheels/
|
||||||
RUN --mount=type=cache,target=/root/.cache/apt \
|
RUN --mount=type=cache,target=/root/.cache/apt \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install --no-install-recommends -y gettext && \
|
apt-get install --no-install-recommends -y gettext supervisor && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
pip install --upgrade pip && \
|
pip install --upgrade pip && \
|
||||||
pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* && \
|
pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* && \
|
||||||
@@ -39,10 +39,15 @@ RUN --mount=type=cache,target=/root/.cache/apt \
|
|||||||
|
|
||||||
COPY --chown=app:app ./docker/prod/django/start /start
|
COPY --chown=app:app ./docker/prod/django/start /start
|
||||||
COPY --chown=app:app ./docker/prod/procrastinate/start /start-procrastinate
|
COPY --chown=app:app ./docker/prod/procrastinate/start /start-procrastinate
|
||||||
|
COPY --chown=app:app ./docker/prod/supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
COPY --chown=app:app ./docker/prod/supervisord/supervisord.conf /etc/supervisord.conf
|
||||||
|
COPY --chown=app:app ./docker/prod/supervisord/start /start-supervisor
|
||||||
RUN sed -i 's/\r$//g' /start && \
|
RUN sed -i 's/\r$//g' /start && \
|
||||||
chmod +x /start && \
|
chmod +x /start && \
|
||||||
sed -i 's/\r$//g' /start-procrastinate && \
|
sed -i 's/\r$//g' /start-procrastinate && \
|
||||||
chmod +x /start-procrastinate
|
chmod +x /start-procrastinate && \
|
||||||
|
sed -i 's/\r$//g' /start-supervisor && \
|
||||||
|
chmod +x /start-supervisor
|
||||||
|
|
||||||
COPY --chown=app:app ./app .
|
COPY --chown=app:app ./app .
|
||||||
|
|
||||||
|
|||||||
9
docker/prod/supervisord/start
Normal file
9
docker/prod/supervisord/start
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
set -o pipefail
|
||||||
|
set -o nounset
|
||||||
|
|
||||||
|
export TASK_WORKERS=${TASK_WORKERS:=1}
|
||||||
|
|
||||||
|
exec supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
||||||
40
docker/prod/supervisord/supervisord.conf
Normal file
40
docker/prod/supervisord/supervisord.conf
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
logfile=/dev/null
|
||||||
|
logfile_maxbytes=0
|
||||||
|
pidfile=/tmp/supervisord.pid
|
||||||
|
|
||||||
|
[supervisorctl]
|
||||||
|
serverurl=unix:///run/supervisord.sock
|
||||||
|
|
||||||
|
[rpcinterface:supervisor]
|
||||||
|
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||||
|
|
||||||
|
[unix_http_server]
|
||||||
|
file=/run/supervisord.sock
|
||||||
|
chmod=0700
|
||||||
|
|
||||||
|
[program:web]
|
||||||
|
user=app
|
||||||
|
directory=/usr/src/app
|
||||||
|
command=/bin/bash /start
|
||||||
|
stdout_logfile=/dev/fd/1
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/fd/2
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
autorestart=true
|
||||||
|
startretries=5
|
||||||
|
|
||||||
|
[program:procrastinate]
|
||||||
|
user=app
|
||||||
|
directory=/usr/src/app
|
||||||
|
command=/bin/bash /start-procrastinate
|
||||||
|
process_name=%(program_name)s_%(process_num)02d
|
||||||
|
numprocs=%(ENV_TASK_WORKERS)s
|
||||||
|
numprocs_start=1
|
||||||
|
stdout_logfile=/dev/fd/1
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/fd/2
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
autorestart=true
|
||||||
|
startretries=5
|
||||||
Reference in New Issue
Block a user