-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
147 lines (137 loc) · 3.9 KB
/
Copy pathdocker-compose.yml
File metadata and controls
147 lines (137 loc) · 3.9 KB
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
140
141
142
143
144
145
146
147
# Reusable vars
x-var:
- &POSTGRES_USER postgres
- &POSTGRES_PASSWORD default
- &POSTGRES_DATABASE postgres
- &node-image node:24
# Reusable envars for postgres
x-postgres-vars: &postgres-vars
POSTGRES_HOST: database
POSTGRES_USER: *POSTGRES_USER
POSTGRES_PASSWORD: *POSTGRES_PASSWORD
POSTGRES_DATABASE: *POSTGRES_DATABASE
services:
database:
image: postgis/postgis:16-3.4 # if using crunchy , make sure to align with crunchy version, currently it is at 16 and postgis 3.3
container_name: database
environment:
<<: *postgres-vars
healthcheck:
test: ["CMD", "pg_isready", "-U", *POSTGRES_USER]
ports: ["5432:5432"]
migrations:
image: flyway/flyway:11-alpine
container_name: migrations
command: info migrate info
volumes: ["./migrations/sql:/flyway/sql:ro"]
environment:
FLYWAY_URL: jdbc:postgresql://database:5432/postgres
FLYWAY_USER: *POSTGRES_USER
FLYWAY_PASSWORD: *POSTGRES_PASSWORD
FLYWAY_BASELINE_ON_MIGRATE: true
FLYWAY_DEFAULT_SCHEMA: csa
depends_on:
database:
condition: service_healthy
schemaspy:
image: schemaspy/schemaspy:7.0.2
profiles: ["schemaspy"]
container_name: schemaspy
command: -t pgsql11 -db postgres -host database -port 5432 -u postgres -p default -schemas csa
depends_on:
migrations:
condition: service_completed_successfully
volumes: ["./output:/output"]
backend:
container_name: backend
profiles: ["app"]
depends_on:
migrations:
condition: service_started
entrypoint: sh -c "npm i && npx prisma generate && npm run start:dev"
environment:
<<: *postgres-vars
NODE_ENV: development
CRA_ENVIRONMENT: test
ENABLE_SWAGGER: "true"
image: *node-image
ports: ["3001:3000"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api"]
working_dir: "/app"
volumes: ["./backend:/app", "/app/node_modules"]
frontend:
container_name: frontend
profiles: ["app"]
entrypoint: sh -c "npm ci --ignore-scripts && npm run dev"
environment:
BACKEND_URL: http://backend:3000
PORT: 3000
NODE_ENV: development
image: *node-image
ports: ["3000:3000"]
volumes: ["./frontend:/app", "/app/node_modules"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
working_dir: "/app"
depends_on:
backend:
condition: service_healthy
backend-prod:
container_name: backend-prod
profiles: ["prod"]
build: ./backend
depends_on:
migrations:
condition: service_started
environment:
<<: *postgres-vars
NODE_ENV: production
CRA_ENVIRONMENT: test
ports: ["3001:3000"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api"]
frontend-prod:
container_name: frontend-prod
profiles: ["prod"]
build: ./frontend
environment:
BACKEND_URL: http://backend-prod:3000
NODE_ENV: production
LOG_LEVEL: INFO
ports: ["3000:3000"]
volumes: ["./frontend:/app", "/app/node_modules"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
depends_on:
backend-prod:
condition: service_healthy
minio:
image: minio/minio
container_name: minio
profiles: ["storage"]
command: server /data --console-address ":9001"
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 5
minio-init:
image: minio/mc
container_name: minio-init
profiles: ["storage"]
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 minioadmin minioadmin;
mc mb --ignore-existing local/csa-bucket;
exit 0;
"