This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
103 lines (98 loc) · 3.45 KB
/
docker-compose.yaml
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
version: "3"
services:
db:
build:
context: ./db
args:
- USER_PASSWORD=${DB_USER_PASSWORD:?db user password must be set}
networks:
- internal-network
volumes:
- ${DB_FILES_PATH:?db files path must be specified so that you never loose them}:/var/lib/postgresql/data
server_app:
build:
context: ./server-app
args:
- BINARY_PATH_APP=/server_binaries/app
- LOGS_DIR=/logs
- IOS_PRIVATE_KEY_PATH=/ios_private_key
- PSQL_HOSTNAME=db
- PSQL_PASSWORD=${DB_USER_PASSWORD:?db user password must be set}
- OSM_PROD_USER=${OSM_PROD_USER:?OSM prod user must be set}
- OSM_PROD_PASSWORD=${OSM_PROD_PASSWORD:?OSM prod user password must be set}
- OSM_TESTING_USER=${OSM_TESTING_USER:?OSM testing user must be set}
- OSM_TESTING_PASSWORD=${OSM_TESTING_PASSWORD:?OSM testing user password must be set}
- OFF_PROD_USER=${OFF_PROD_USER:?OFF prod user must be set}
- OFF_PROD_PASSWORD=${OFF_PROD_PASSWORD:?OFF prod user password must be set}
- OFF_TESTING_USER=${OFF_TESTING_USER:?OFF testing user must be set}
- OFF_TESTING_PASSWORD=${OFF_TESTING_PASSWORD:?OFF testing user password must be set}
- AWS_S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME:?AWS S3 bucket name must be set}
- AWS_S3_REGION=${AWS_S3_REGION:?AWS S3 region must be set}
- AWS_S3_ACCESS_KEY_ID=${AWS_S3_ACCESS_KEY_ID:?AWS S3 access key ID must be set}
- AWS_S3_SECRET_ACCESS_KEY=${AWS_S3_SECRET_ACCESS_KEY:?AWS S3 secret access key must be set}
- JWT_SECRET=${JWT_SECRET:?JWT secret must be set}
- METRICS_ENDPOINT=${METRICS_ENDPOINT:?a random METRICS_ENDPOINT must be set}
networks:
- internal-network
- external-network
ports:
- "127.0.0.1:8080:8080"
volumes:
- ${BINARY_PATH_APP:?path to binary must be set}:/server_binaries/app
- ${LOGS_DIR:?path to logs dir of server must be set}:/logs
- ${IOS_PRIVATE_KEY_PATH:?path to iOS private key must be set}:/ios_private_key
depends_on:
- db
restart: always
deploy:
resources:
limits:
memory: 256M
db_backupper:
build:
context: ./db-backupper
args:
- BACKUPS_DIR_PATH=/backups
- BACKUPS_HOUR_MINUTE=${BACKUPS_HOUR_MINUTE:?backups time must be set}
- PSQL_URL=postgresql://main_user:${DB_USER_PASSWORD}@db/main
networks:
- internal-network
volumes:
- ${BACKUPS_DIR_PATH:?path to dir for backups files}:/backups
depends_on:
- db
# https://medium.com/@math21/how-to-monitor-a-ktor-server-using-grafana-bab54a9ac0dc
prometheus:
build:
context: ./prometheus
args:
- METRICS_ENDPOINT=${METRICS_ENDPOINT:?a random METRICS_ENDPOINT must be set}
restart: always
ports:
- "3570:9090"
command: --config.file=/etc/prometheus/prometheus.yml --log.level=debug
networks:
- internal-network
links:
- server_app
# https://medium.com/@math21/how-to-monitor-a-ktor-server-using-grafana-bab54a9ac0dc
grafana:
build:
context: ./grafana
args:
- GRAFANA_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:?grafana admin password must be set}
ports:
- 3000:3000
user: "104"
networks:
- internal-network
- external-network
links:
- server_app
- prometheus
networks:
internal-network:
driver: bridge
internal: true
external-network:
driver: bridge