forked from busy-beaver-dev/busy-beaver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
139 lines (133 loc) · 3.43 KB
/
docker-compose.prod.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
version: '3.6'
networks:
sivnet:
external: true
local:
external: false
volumes:
pgdata:
bb-logs:
services:
# infrastructure
db:
image: postgres:10.3-alpine
environment:
POSTGRES_DB: busy-beaver
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
volumes:
- pgdata:/var/lib/postgresql/data/
ports:
- "9432:5432"
networks:
- local
labels:
- traefik.enable=false
redis:
image: redis:4.0-alpine
healthcheck:
test: ["CMD-SHELL", "redis-cli","ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
networks:
- local
# busy-beaver business logic
app:
image: alysivji/busy-beaver:latest
command: webserver
environment: &app_env_vars
IN_PRODUCTION: 1
PYTHONPATH: .
FLASK_APP: /app/busy_beaver/__init__.py
DATABASE_URI: ${DATABASE_URI}
REDIS_URI: ${REDIS_URI}
SLACK_BOTUSER_OAUTH_TOKEN: ${SLACK_BOTUSER_OAUTH_TOKEN}
SLACK_SIGNING_SECRET: ${SLACK_SIGNING_SECRET}
GITHUB_OAUTH_TOKEN: ${GITHUB_OAUTH_TOKEN}
GITHUB_APP_CLIENT_ID: ${GITHUB_APP_CLIENT_ID}
GITHUB_APP_CLIENT_SECRET: ${GITHUB_APP_CLIENT_SECRET}
TWITTER_CONSUMER_KEY: ${TWITTER_CONSUMER_KEY}
TWITTER_CONSUMER_SECRET: ${TWITTER_CONSUMER_SECRET}
TWITTER_ACCESS_TOKEN: ${TWITTER_ACCESS_TOKEN}
TWITTER_ACCESS_TOKEN_SECRET: ${TWITTER_ACCESS_TOKEN_SECRET}
SENTRY_DSN: ${SENTRY_DSN}
volumes: &app_volumes
- bb-logs:/app/logs/
networks:
- sivnet
- local
labels:
- com.centurylinklabs.watchtower.enable=true
- traefik.enable=true
- traefik.docker.network=sivnet
- traefik.backend=busybeaver
- traefik.frontend.rule=Host:busybeaver.sivji.com
- traefik.port=5000
worker:
image: alysivji/busy-beaver:latest
command: worker
environment: *app_env_vars
volumes: *app_volumes
networks:
- local
labels:
- com.centurylinklabs.watchtower.enable=true
- traefik.enable=false
# agents to support busy-beaver
watchtower: # restart app container when new releases
image: v2tec/watchtower
command: --label-enable --cleanup
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- local
labels:
- traefik.enable=false
datadog: # collect logs
build: datadog
depends_on:
- app
links:
- app
environment:
- DD_API_KEY=${DATADOG_API_KEY}
- DD_HOSTNAME=busybeaver.sivji.com
- DD_LOGS_ENABLED=true
- DD_ENABLE_PAYLOADS_EVENTS=false
- DD_ENABLE_PAYLOADS_SERIES=false
- DD_ENABLE_PAYLOADS_SERVICE_CHECKS=false
- DD_ENABLE_PAYLOADS_SKETCHES=false
volumes:
- bb-logs:/busy-beaver/logs
- /var/run/docker.sock:/var/run/docker.sock
- /proc/:/host/proc/:ro
- /sys/fs/cgroup:/host/sys/fs/cgroup:ro
networks:
- local
labels:
- traefik.enable=false
# tools
admin:
image: jeffknupp/sandman2
environment:
DB_TYPE: postgres
DB_DRIVER: psycopg2
DB_HOST: db
DB_PORT: 5432
DATABASE: busy-beaver
USERNAME: ${POSTGRES_USER}
PASSWORD: ${POSTGRES_PASSWORD}
ports:
- 9000:5000
networks:
- local
labels:
- traefik.enable=false