-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduction.compose.yml
100 lines (90 loc) · 2.7 KB
/
production.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
name: javaflavors
x-pg-db-credentials: &pg-db-credentials
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
x-db-front-credentials: &db-front-credentials
DB_FRONT_NAME: ${DB_FRONT_NAME:-device-manager-front}
DB_FRONT_USER: ${DB_FRONT_USER:-device-manager-front}
DB_FRONT_PASSWORD: ${DB_FRONT_PASSWORD:-device-manager-front}
x-db-api-credentials: &db-api-credentials
DB_API_NAME: ${DB_API_NAME:-device-manager-api}
DB_API_USER: ${DB_API_USER:-device-manager-api}
DB_API_PASSWORD: ${DB_API_PASSWORD:-device-manager-api}
x-oidc-settings: &oidc-settings
OIDC_AUTHORIZE_URL: ${OIDC_AUTHORIZE_URL}
OIDC_TOKEN_URL: ${OIDC_TOKEN_URL}
OIDC_CLIENT_ID: ${OIDC_CLIENT_ID}
OIDC_CLIENT_SECRET: ${OIDC_CLIENT_SECRET}
OIDC_ISSUER_URI: ${OIDC_ISSUER_URI}
OIDC_JWKS_URI: ${OIDC_JWKS_URI}
x-web-server-settings: &web-server-settings
DB_USER: ${DB_FRONT_USER:-device-manager-front}
DB_PASSWORD: ${DB_FRONT_PASSWORD:-device-manager-front}
DB_NAME: ${DB_FRONT_NAME:-device-manager-front}
PUBLIC_API_URL: ${PUBLIC_API_URL}
PUBLIC_URL: ${PUBLIC_URL}
x-api-server-settings: &api-server-settings
DB_URL: jdbc:postgresql://postgres:5432/${DB_API_NAME:-device-manager-api}
DB_PASSWORD: ${DB_API_PASSWORD:-device-manager-api}
DB_USERNAME: ${DB_API_USER:-device-manager-api}
services:
postgres:
image: javaflavors-postgres:latest
build:
context: docker
dockerfile: Dockerfile
pull_policy: build
environment:
<<: [*pg-db-credentials, *db-front-credentials, *db-api-credentials]
volumes:
- javaflavors-db-data:/var/lib/postgresql/data
ports:
- "5432:5432"
expose:
- "5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 5s
retries: 5
web:
image: javaflavors-front:latest
build:
context: web
dockerfile: Dockerfile
pull_policy: build
expose:
- "3000"
ports:
- ${WEB_PORT:-3000}:3000
environment:
<<: [*oidc-settings, *web-server-settings]
DB_HOST: postgres
DB_PORT: 5432
PUBLIC_INTERNAL_API_URL: ${PUBLIC_API_URL}
PROTOCOL_HEADER: x-forwarded-proto
HOST_HEADER: x-forwarded-host
ORIGIN: ${PUBLIC_URL}
depends_on:
postgres:
condition: service_healthy
api:
image: javaflavors-api:latest
build:
context: api
dockerfile: Dockerfile
pull_policy: build
ports:
- ${API_PORT:-8080}:8080
expose:
- "8080"
environment:
<<: [*oidc-settings, *api-server-settings]
volumes:
- javaflavors-media:/app/media
depends_on:
postgres:
condition: service_healthy
volumes:
javaflavors-db-data:
javaflavors-media: