generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
104 lines (102 loc) · 2.28 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
---
version: "3.8"
services:
database:
build:
context: database
container_name: database
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
hostname: database
healthcheck:
test: [ "CMD", "pg_isready", "-U", "postgres" ]
ports:
- "5432:5432"
restart: always
user: postgres
volumes:
- "./data:/pgdata"
networks:
- default
database-migrations:
image: flyway/flyway:9.19-alpine
container_name: backend-migrations
command:
- info
- migrate
- info
volumes:
- "./backend/db/migrations:/flyway/sql"
environment:
- FLYWAY_URL=jdbc:postgresql://database:5432/postgres
- FLYWAY_USER=postgres
- FLYWAY_PASSWORD=postgres
- FLYWAY_BASELINE_ON_MIGRATE=true
- FLYWAY_DEFAULT_SCHEMA=USERS
depends_on:
database:
condition: service_healthy
networks:
- default
backend:
container_name: backend
entrypoint:
- "sh"
- "-c"
- "npm i && npm run start"
environment:
NODE_ENV: development
POSTGRESQL_HOST: database
POSTGRESQL_USER: postgres
POSTGRESQL_PASSWORD: postgres
POSTGRESQL_DATABASE: postgres
hostname: backend
image: registry.access.redhat.com/ubi8/nodejs-18-minimal
links:
- database
ports:
- "3001:3000"
volumes:
- ./backend:/app:z
- /app/node_modules
user: root
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:3000" ]
working_dir: "/app"
depends_on:
database:
condition: service_healthy
database-migrations:
condition: service_started
networks:
- default
frontend:
container_name: frontend
entrypoint:
- "sh"
- "-c"
- "chown -R root . && npm ci && npm run dev"
environment:
NODE_ENV: development
BACKEND_URL: backend
hostname: frontend
image: registry.access.redhat.com/ubi8/nodejs-18-minimal
links:
- backend
ports:
- "3000:3000"
volumes:
- ./frontend:/app:z
- /app/node_modules
user: root
working_dir: "/app"
depends_on:
backend:
condition: service_healthy
networks:
- default
networks:
default:
driver: bridge