-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.deploy.yml
72 lines (70 loc) · 2.31 KB
/
docker-compose.deploy.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
# Used for deployment to a server where we are getting images from Docker Hub
# Overlay ontop of base config with:
# $ export IMAGE_TEST="v2022-05-20.ABCD1234"
# $ docker compose -f docker-compose.yml -f docker-compose.deploy.yml up -d
# Set IMAGE_TAG to the image desired, such as:
# dev
# staging
# vYYYY-MM-DD.SHA
#
# It includes the following containers:
# - Flask (extended, running using prod server)
# - MySQL (extended)
# - Caddy
services:
flask:
image: drbfraser/cradle_platfrom-backend:$IMAGE_TAG
restart: always
command: gunicorn -c ./prod/gunicorn.conf.py app:app
volumes:
- flask_logs:/var/log
mysql:
restart: always
logging:
driver: fluentd
options:
tag: docker.{{.Name}}.{{.ID}}
fluentd-async: "true"
fluentd-address: tcp://localhost:24224
volumes:
- mysql_logs:/var/log
- "./:/etc/mysql/conf.d"
caddy:
container_name: cradle_caddy
image: drbfraser/cradle_platfrom-revproxy_frontend:$IMAGE_TAG
build:
context: .
dockerfile: caddy/Dockerfile
restart: always
environment:
- DOMAIN=${DOMAIN}
- API_HOSTNAME=cradle_flask
ports:
- 80:80
- 443:443
volumes:
- caddy_logs:/var/log
fluentbit:
container_name: cradle_fluentbit
image: fluent/fluent-bit:2.0.5
restart: always
volumes:
- caddy_logs:/logs/caddy:ro
- mysql_logs:/logs/mysql:ro
- flask_logs:/logs/flask:ro
- fluentbit_logs_db:/persist
- fluentbit_logs_output:/output
- ./fluentbit/config:/fluent-bit/etc
ports:
- "24224:24224"
environment:
# Used in staging/prod environment
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
command: ["fluent-bit", "-c", "/fluent-bit/etc/fluent-${ENV:-local}.conf"]
volumes:
flask_logs:
caddy_logs:
mysql_logs:
fluentbit_logs_db:
fluentbit_logs_output: