File size: 1,878 Bytes
c01f819
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log

[program:redis]
command=/usr/bin/redis-server --save "" --appendonly no
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
priority=10

; Postgres is optional: controlled by USE_INTERNAL_POSTGRES env
[program:postgres]
command=/bin/bash -lc "if [ \"$USE_INTERNAL_POSTGRES\" = \"true\" ]; then \
    mkdir -p /data/postgres && \
    chown -R postgres:postgres /data/postgres && \
    su - postgres -c '/usr/lib/postgresql/15/bin/initdb -D /data/postgres' || true && \
    su - postgres -c \"/usr/lib/postgresql/15/bin/pg_ctl -D /data/postgres -l /data/postgres/logfile start\" && \
    sleep 2 && \
    su - postgres -c \"psql -c 'CREATE USER %%(POSTGRES_USER)s WITH PASSWORD '\\''%%(POSTGRES_PASSWORD)s'\\'';'\" || true && \
    su - postgres -c \"psql -c 'CREATE DATABASE %%(POSTGRES_DB)s OWNER %%(POSTGRES_USER)s;'\" || true && \
    tail -f /data/postgres/logfile; \
  else \
    echo 'USE_INTERNAL_POSTGRES != true; skipping postgres start' && tail -f /dev/null; \
  fi"
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
priority=15
environment=POSTGRES_USER=%(ENV_POSTGRES_USER)s,POSTGRES_PASSWORD=%(ENV_POSTGRES_PASSWORD)s,POSTGRES_DB=%(ENV_POSTGRES_DB)s

[program:celery]
command=/bin/bash -lc "cd /app && celery -A app.tasks.celery_app worker --loglevel=INFO"
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
priority=20

[program:uvicorn]
command=/bin/bash -lc "python -m app.main"
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
priority=30