This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
81 lines (76 loc) · 1.79 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
# Reusable vars
x-var:
- &POSTGRES_USER
postgres
# Postgres envars
x-postgres-vars: &postgres-vars
POSTGRES_DATABASE: postgres
POSTGRES_HOST: quackStack-db
POSTGRES_PASSWORD: default
POSTGRES_USER: *POSTGRES_USER
name: quackstack-bb
services:
# DB
database:
build:
context: ./database
dockerfile: Dockerfile
container_name: quackStack-db
environment:
<<: *postgres-vars
ports: [5432:5432]
healthcheck:
test: ["CMD", "pg_isready", "-U", *POSTGRES_USER]
# PGAdmin
pgadmin:
container_name: quackStack-pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
image: dpage/pgadmin4
ports: [5050:80]
profiles: ["pgadmin"]
# Backend
backend:
build:
context: ./backend
dockerfile: Dockerfile
command: npm run ${CMD:-dev}
container_name: quackStack-api
depends_on:
database:
condition: service_healthy
develop:
watch:
- action: sync
path: ./backend/
target: app
ignore: [node_modules]
environment:
LOG_LEVEL: info
PORT: 3000
<<: *postgres-vars
healthcheck:
test: curl localhost:3000/api/health | grep 'NMP API is healthy and ready!'
ports: [3000:3000]
# Frontend
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
command: npm run ${CMD:-dev}
container_name: quackStack-frontend
depends_on:
backend:
condition: service_healthy
develop:
watch:
- action: sync
path: ./frontend
target: /app
ignore: [node_modules]
environment:
VITE_BACKEND_URL: http://localhost:3000/api
healthcheck:
test: curl --fail http://localhost:5173 || exit 1
ports: [5173:5173]