-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
135 lines (122 loc) · 3.89 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
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
name: bioloop
services:
ui:
image: node:19
volumes:
- ./ui/:/opt/sca/app
- ui_modules:/opt/sca/app/node_modules
ports:
- 127.0.0.1:443:443
working_dir: /opt/sca/app
# command: sh -c "npm install && exec /opt/sca/app/node_modules/.bin/vite --host"
# entrypoint: [ "tail", "-f", "/dev/null" ]
entrypoint:
- sh
- -c
- |
npm install && exec /opt/sca/app/node_modules/.bin/vite --host
api:
image: node:19
# user: ${APP_UID}:${APP_GID}
# build:
# context: ./api
# args:
# APP_UID: ${APP_UID} # read from .env file
# APP_GID: ${APP_GID} # read from .env file
# environment:
# - APP_UID=APP_UID
# - APP_GID=APP_GID
volumes:
- ./api/:/opt/sca/app
- api_modules:/opt/sca/app/node_modules
expose:
- 3030
ports:
- 127.0.0.1:3030:3030
working_dir: /opt/sca/app
# entrypoint: ["tail", "-f", "/dev/null"]
# command: sh -c "sleep infinity"
entrypoint:
- sh
- -c
- |
npm install \
&& npx prisma generate client \
&& exec /opt/sca/app/node_modules/.bin/nodemon --signal SIGTERM src/index.js
extra_hosts:
- "host.docker.internal:host-gateway" # for connecting to services running on localhost of the host network
depends_on:
- postgres
postgres:
image: postgres:14.5
# restart: unless-stopped
environment:
- POSTGRES_USER=appuser
- POSTGRES_PASSWORD=example
- POSTGRES_DB=app
volumes:
- ./db/db_postgres:/var/lib/postgresql/data
- ./db/postgres/scripts:/docker-entrypoint-initdb.d
- ./db/postgres/aux_scripts:/opt/sca/scripts
- ./db/backups:/opt/sca/backups
- ./db/postgres/config/postgresql.conf:/etc/postgresql/postgresql.conf # Mount the config file
command: -c 'config_file=/etc/postgresql/postgresql.conf'
ports:
- 127.0.0.1:5432:5432
expose:
- 5432
nginx:
image: nginx:1.25
ports:
- 80:80
- 443:443
volumes:
- ./nginx/src:/usr/share/nginx/html # Mount for Nginx static files
- ./nginx/conf:/etc/nginx/conf.d # Mount for Nginx configuration files
- ./data:/opt/sca/data:ro # Mount for data directory
- ./ui/dist:/opt/sca/ui:ro # Mount for UI static files
- ./nginx/logs:/var/log/nginx # Mount for Nginx logs
- ./ui/.cert:/etc/nginx/certs:ro # Mount for SSL certificates
extra_hosts:
- "host.docker.internal:host-gateway" # for connecting to services running on localhost of the host network
postgres_exporter:
image: prometheuscommunity/postgres-exporter
environment:
DATA_SOURCE_NAME: "postgresql://appuser:example@postgres:5432/app?sslmode=disable"
depends_on:
- postgres
# ports:
# - "9187:9187"
volumes:
- ./metrics/postgres_exporter/queries.yml:/etc/postgres_exporter/queries.yml
command:
- "--extend.query-path=/etc/postgres_exporter/queries.yml"
prometheus:
image: prom/prometheus
volumes:
- ./metrics/prometheus/config/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus # Mount the volume for Prometheus data
command:
- '--config.file=/etc/prometheus/prometheus.yml'
# ports:
# - "9090:9090"
grafana:
image: grafana/grafana
volumes:
- grafana_data:/var/lib/grafana # Mount for Grafana data (dashboards, plugins)
- ./metrics/grafana/config:/etc/grafana # Mount for custom Grafana configuration
- ./api/keys/auth.pub:/etc/grafana/auth.pub
depends_on:
- prometheus
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
ui_modules:
external: false
api_modules:
external: false
grafana_data:
prometheus_data: