generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.java.yml
77 lines (75 loc) · 1.87 KB
/
docker-compose.java.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
---
version: "3.9"
services:
database-java:
build:
context: database
container_name: java-api-database
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
hostname: database-py
healthcheck:
test: [ "CMD", "pg_isready", "-U", "postgres" ]
ports:
- "5420:5432"
restart: unless-stopped
user: postgres
volumes:
- "./java-api-data:/pgdata"
networks:
- default
backend-java:
image: maven:3.8.7-eclipse-temurin-17
working_dir: /application
build:
context: backend-java
container_name: backend-java
command: ./mvnw compile quarkus:dev
volumes: # don't volume mount the entire backend python as it would remove the venv
- ./backend-java:/application
- ~/.m2:/root/.m2
environment:
POSTGRES_SERVER: database-py
POSTGRESQL_USER: postgres
POSTGRESQL_PASSWORD: postgres
POSTGRESQL_DATABASE: postgres
restart: unless-stopped
hostname: backend-java
ports:
- "3004:3000"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:3000" ]
depends_on:
database-java:
condition: service_healthy
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@sha256:74af9dc2b620022c77fcd712b811f64a03c1444ff1e9b9596a242b2edf3cf96f
ports:
- "3000:3000"
volumes:
- ./frontend:/app:z
- /app/node_modules
user: root
working_dir: "/app"
restart: unless-stopped
depends_on:
backend-java:
condition: service_healthy
networks:
- default
networks:
default:
driver: bridge