generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
94 lines (89 loc) · 2.65 KB
/
docker-compose.yml
File metadata and controls
94 lines (89 loc) · 2.65 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
# Reusable vars
x-var:
- &POSTGRES_USER
postgres
- &POSTGRES_PASSWORD
default
- &POSTGRES_DATABASE
postgres
# 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:17-3.5 # Updated to PostgreSQL 17 with PostGIS 3.4
container_name: database
environment:
<<: *postgres-vars
healthcheck:
test: ["CMD", "pg_isready", "-U", *POSTGRES_USER]
ports: ["5432:5432"]
migrations:
image: ${FLYWAY_IMAGE:-flyway/flyway:12-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: app
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 app
depends_on:
migrations:
condition: service_completed_successfully
volumes: ["./output:/output"]
backend:
container_name: backend
depends_on:
migrations:
condition: service_completed_successfully
environment:
<<: *postgres-vars
NODE_ENV: development
PORT: 3001
image: ${BACKEND_IMAGE:-backend}
build:
context: ./backend
ports: ["3001:3001"]
healthcheck:
start_interval: 5s
start_period: 5s
interval: 10s
timeout: 3s
retries: 6
test: ["CMD","/nodejs/bin/node", "-pe", "require('http').get('http://[::1]:3001/api/health', function(res){console.log('Health check status:', res.statusCode); process.exit(res.statusCode === 200 ? 0 : 1)}).on('error', function(err){console.error('Health check error:', err.message); process.exit(1);});"]
working_dir: "/app"
frontend:
container_name: frontend
build:
context: ./frontend
environment:
VITE_BACKEND_URL: http://backend:3001
VITE_PORT: 3000
NODE_ENV: development
LOG_LEVEL: debug
image: ${FRONTEND_IMAGE:-frontend}
ports: ["3000:3000"]
healthcheck:
start_interval: 5s
start_period: 5s
interval: 10s
timeout: 3s
retries: 6
test: ["CMD", "curl", "-f", "http://0.0.0.0:3001/health"]
working_dir: "/app"
depends_on:
backend:
condition: service_started