-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
130 lines (118 loc) · 3.41 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
services:
nats1:
image: nats:latest
ports:
- "4222:4222"
- "8222:8222" # Monitoring port.
- "9222:9222" # websocket
command: >
-c /etc/nats/nats.conf
volumes:
- "./nats-conf/nats1.conf:/etc/nats/nats.conf"
nats2:
image: nats:latest
command: >
-c /etc/nats/nats.conf
volumes:
- "./nats-conf/nats2.conf:/etc/nats/nats.conf"
depends_on:
- nats1
nats3:
image: nats:latest
command: >
-c /etc/nats/nats.conf
volumes:
- "./nats-conf/nats3.conf:/etc/nats/nats.conf"
depends_on:
- nats2
# Checks for health of nats server before allowing others to start up
nats-healthcheck:
image: curlimages/curl
command: > # better command than sleep infinity because it exits more quickly
/bin/sh -c "trap 'exit' TERM; while true; do sleep 1; done"
depends_on:
nats1:
condition: service_started
nats2:
condition: service_started
nats3:
condition: service_started
healthcheck:
test: ["CMD", "curl", "-f", "--connect-timeout", "3", "http://nats1:8222/healthz?js-enabled-only=true"]
start_period: "3s"
interval: "14s"
timeout: "3s"
retries: "3"
db:
image: postgres:12
restart: always
volumes:
- app-db-data:/var/lib/postgresql/data/pgdata
env_file:
- .env
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_DB=${POSTGRES_DB?Variable not set}
backend:
image: '${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG-latest}'
restart: always
depends_on:
db:
condition: service_started
nats-healthcheck:
condition: service_healthy
ports:
- "8080:80"
env_file:
- .env
environment:
- DOMAIN=${DOMAIN}
- ENVIRONMENT=${ENVIRONMENT}
- BACKEND_CORS_ORIGINS=${BACKEND_CORS_ORIGINS}
- SECRET_KEY=${SECRET_KEY?Variable not set}
- FIRST_SUPERUSER=${FIRST_SUPERUSER?Variable not set}
- FIRST_SUPERUSER_PASSWORD=${FIRST_SUPERUSER_PASSWORD?Variable not set}
- SMTP_HOST=${SMTP_HOST}
- SMTP_USER=${SMTP_USER}
- SMTP_PASSWORD=${SMTP_PASSWORD}
- EMAILS_FROM_EMAIL=${EMAILS_FROM_EMAIL}
- POSTGRES_SERVER=db
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- SENTRY_DSN=${SENTRY_DSN}
build:
context: ./backend/app
args:
INSTALL_DEV: ${INSTALL_DEV-false}
platform: linux/amd64 # Patch for M1 Mac
orchestrator:
image: '${DOCKER_IMAGE_ORCHESTRATOR?Variable not set}:${TAG-latest}'
restart: always
depends_on:
db:
condition: service_started
nats-healthcheck:
condition: service_healthy
backend:
condition: service_started
env_file:
- .env
build:
context: ./backend/
dockerfile: ./backend/orchestrator/Dockerfile
args:
INSTALL_DEV: ${INSTALL_DEV-false}
# frontend:
# image: '${DOCKER_IMAGE_FRONTEND?Variable not set}:${TAG-latest}'
# restart: always
# build:
# context: ./frontend
# args:
# - VITE_API_URL=https://${DOMAIN?Variable not set}
# - NODE_ENV=production
volumes:
app-db-data: