generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
61 lines (56 loc) · 1.73 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
# 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: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:10-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: codes
depends_on:
database:
condition: service_healthy
schemaspy:
image: schemaspy/schemaspy:6.2.4
profiles: ["schemaspy"]
container_name: schemaspy
command: -t pgsql11 -db postgres -host database -port 5432 -u postgres -p default -schemas codes
depends_on:
migrations:
condition: service_completed_successfully
volumes: ["./output:/output"]
backend:
container_name: backend
depends_on:
migrations:
condition: service_started
environment:
<<: *postgres-vars
build:
context: apps
dockerfile: apps/Codes/Codes.Server/Dockerfile
ports: ["8080:8080"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]