Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
120 lines (112 loc) · 3.55 KB
/
Copy pathcompose.yaml
File metadata and controls
120 lines (112 loc) · 3.55 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
---
# Test infrastructure for DesktopApplicationClientJava integration tests.
#
# Mirrors the contract of the backend (pks-java) compose file: same services,
# same ports, same environment variable names (see .env.example).
# Run only ONE stack at a time (this one OR the backend one) — ports overlap.
#
# Default: postgres + redis (enough for auth/resource/user/admin ITs):
# docker compose up -d
services:
client:
build: .
image: desktop-client
profiles: [gui]
environment:
- INITIAL_PAGE_PATH=${INITIAL_PAGE_PATH:-/fxml/LoginForm.fxml}
- MOCK_DATA=${MOCK_DATA:-false}
- DISPLAY=${DISPLAY:-}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:ro
backend:
image: detfiniktn/java-pks:latest
container_name: backend
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
# Без healthcheck: образ собран buildpacks без shell/curl/wget, поэтому внутреннюю
# HTTP-пробу выполнить нечем (CMD-SHELL падает с "stat /bin/sh: no such file or directory",
# давая ложный статус unhealthy). На health бэкенда ничего не завязано (depends_on
# на него нет); готовность видна по логам ("Started JavaPksApplication") и порту 8080.
ports:
- "8080:8080"
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/pks_dev
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD}
SPRING_DATA_REDIS_HOST: redis
SPRING_DATA_REDIS_PORT: "6379"
JWT_SECRET: ${JWT_SECRET}
volumes:
- ./.env:/workspace/.env:ro
restart: on-failure:1
postgres:
image: postgres:16-alpine
container_name: db
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_USER=${POSTGRES_USER}
healthcheck:
interval: 10s
retries: 5
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
timeout: 5s
ports:
- "5432:5432"
restart: on-failure
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
healthcheck:
interval: 10s
retries: 5
test: ["CMD", "redis-cli", "ping"]
timeout: 5s
ports:
- "6379:6379"
restart: on-failure
volumes:
- redis_basic_data:/data
minio:
image: pgsty/minio:latest
command: server /data --console-address ":9001"
environment:
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}
- MINIO_ROOT_USER=${MINIO_ROOT_USER}
healthcheck:
interval: 10s
retries: 5
test: ["CMD-SHELL", "curl -f http://localhost:9000/minio/health/live || exit 1"]
timeout: 5s
ports:
- "9000:9000" # S3 API
- "9001:9001" # Web Console
restart: on-failure
volumes:
- minio_data:/data
minio-init:
image: pgsty/mc:latest
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set myminio http://minio:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD};
mc mb myminio/${MINIO_BUCKET_NAME} --ignore-existing;
mc admin user add myminio ${MINIO_ACCESS_TOKEN} ${MINIO_SECRET_KEY};
mc admin policy attach myminio readwrite --user ${MINIO_ACCESS_TOKEN};
exit 0;
"
restart: on-failure
volumes:
minio_data:
driver: local
postgres_data:
driver: local
redis_basic_data: