-
Notifications
You must be signed in to change notification settings - Fork 48
/
docker-compose.yml
81 lines (75 loc) · 1.8 KB
/
docker-compose.yml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
version: "3"
volumes:
pg_data:
services:
postgres-website:
image: postgres:10.0
container_name: postgres-website
restart: always
# Data persistence, comment out the following two lines to disable
volumes:
- pg_data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=origin
- POSTGRES_PASSWORD=origin
- POSTGRES_DB=origin_website
redis:
image: redis
container_name: redis
restart: always
sysctls:
- net.core.somaxconn=4096
origin-website:
container_name: origin-website
build:
context: .
dockerfile: ./Dockerfile
image: origin-website
volumes:
- ./:/app
- ./docker.env:/app/.env
depends_on:
- postgres-website
- redis
ports:
- "5000:5000"
- "5555:5555"
environment:
- FLASK_APP=/app/main.py
command:
>
/bin/bash -c "flask db upgrade &&
python /app/main.py"
celery:
container_name: celery
image: origin-website
user: nobody
depends_on:
- postgres-website
- redis
volumes:
- ./:/app
- ./docker.env:/app/.env
environment:
- FLASK_APP=/app/main.py
command:
>
/bin/bash -c "/usr/local/bin/watchmedo auto-restart -d . -p '*.py' -i '*.pyc' --recursive --
celery -A util.tasks worker --loglevel=INFO"
crontainer:
container_name: crontainer
build:
context: .
dockerfile: ./dev/Dockerfile.cron
volumes:
- ./:/app
- ./docker.env:/app/.env
depends_on:
- postgres-website
- redis
environment:
- FLASK_APP=/app/main.py
# https://manpages.debian.org/buster/cron/cron.8.en.html
command:
>
/bin/bash -c "/app/dev/run_jobs.sh && echo 'Crontainer started. Starting cron...' && cron && tail -F /var/log/cron.log"