forked from wso2/api-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
101 lines (96 loc) · 3.15 KB
/
docker-compose.yaml
File metadata and controls
101 lines (96 loc) · 3.15 KB
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
# --------------------------------------------------------------------
# Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# --------------------------------------------------------------------
services:
postgres:
image: postgres:latest
container_name: postgres
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: devportal
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql
- ../../portals/developer-portal/artifacts/script.sql:/docker-entrypoint-initdb.d/01-init-devportal.sql
- ../../platform-api/src/internal/database/init-platform-api-db.sql:/docker-entrypoint-initdb.d/02-init-platform-api.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d devportal"]
interval: 5s
timeout: 5s
retries: 5
devportal:
build:
context: ../../portals/developer-portal
dockerfile: Dockerfile
container_name: devportal
ports:
- "3001:3001"
volumes:
- ../../portals/developer-portal/config.json:/app/config.json:ro
- ../../portals/developer-portal/secret.json:/app/secret.json:ro
depends_on:
postgres:
condition: service_healthy
platform-api:
image: ghcr.io/wso2/api-platform/platform-api:latest
build:
context: ../../platform-api
dockerfile: Dockerfile
additional_contexts:
common: ../../common
ports:
- "9243:9243"
volumes:
- platform-api-data:/api-platform/data
environment:
- DEFAULT_DEVPORTAL_API_URL=http://devportal:3001
- DATABASE_DRIVER=postgres
- DATABASE_HOST=postgres
- DATABASE_PORT=5432
- DATABASE_NAME=platform_api
- DATABASE_USER=postgres
- DATABASE_PASSWORD=postgres
- DATABASE_SSL_MODE=disable
- DATABASE_MAX_OPEN_CONNS=25
- DATABASE_MAX_IDLE_CONNS=10
- DATABASE_CONN_MAX_LIFETIME=300
- DB_SCHEMA_PATH=./schema.postgres.sql
- DATABASE_EXECUTE_SCHEMA_DDL=true
- DATABASE_SUBSCRIPTION_TOKEN_ENCRYPTION_KEY=${DATABASE_SUBSCRIPTION_TOKEN_ENCRYPTION_KEY}
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "-O", "/dev/null", "--no-check-certificate", "https://localhost:9243/health"]
interval: 30s
timeout: 10s
start_period: 5s
retries: 3
management-portal:
build:
context: ../../portals/management-portal
dockerfile: Dockerfile
ports:
- "5173:5173"
depends_on:
platform-api:
condition: service_healthy
volumes:
platform-api-data:
driver: local
postgres_data: