-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
86 lines (79 loc) · 2.44 KB
/
compose.yml
File metadata and controls
86 lines (79 loc) · 2.44 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
# =========================================
# Compose BASIQUE pour dev JPA/REST
# PostgreSQL + Application Quarkus
# =========================================
services:
# Base de données PostgreSQL
postgres:
# Image officielle PostgreSQL Alpine
image: postgres:16-alpine
# Les variables d'environnement peuvent être définies dans un fichier .env
container_name: postgres-db
environment:
POSTGRES_DB: ${DB_NAME:-products}
POSTGRES_USER: ${DB_USER:-tpuser}
POSTGRES_PASSWORD: ${DB_PASSWORD:-Tp@2026}
ports:
# Exposer sur l'hôte pour accès direct (DBeaver, pgAdmin, etc.)
- "${DB_HOST_PORT:-15432}:5432"
volumes:
# Persistance des données dans un volume nommé
- postgres_data:/var/lib/postgresql/data
networks:
# Connexion au réseau commun
- product-network
# Vérification de l'état de santé de PostgreSQL
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${DB_USER:-tpuser} -d ${DB_NAME:-products}",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# Application Quarkus JPA/REST
product-catalog:
# Image de l'application, configurable via des variables d'environnement
image: ${IMAGE_GROUP:-brunoe}/${IMAGE_NAME:-product-catalog}:${IMAGE_TAG:-1.0.0-jib}
# Dépendance sur PostgreSQL avec vérification de santé
depends_on:
postgres:
condition: service_healthy
environment:
# Configuration base de données pour Quarkus
DB_HOST: postgres
DB_PORT: 5432
DB_USER: ${DB_USER:-tpuser}
DB_PASSWORD: ${DB_PASSWORD:-Tp@2026}
# Stratégie Hibernate (update pour dev, validate pour prod)
HIBERNATE_GENERATION: ${HIBERNATE_GENERATION:-update}
# Logs
LOG_LEVEL: ${LOG_LEVEL:-INFO}
LOG_SQL: ${LOG_SQL:-false}
# JVM Options
JAVA_OPTS: >-
-Xms256m
-Xmx512m
-XX:+UseContainerSupport
-XX:MaxRAMPercentage=75.0
ports:
# HTTP direct (pour developpement)
- "${APP_HTTP_PORT:-8080}:8080"
networks:
- product-network
# Vérification de l'état de santé de l'application Quarkus
healthcheck:
test:
["CMD-SHELL", "curl -f http://localhost:8080/health/ready || exit 1"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
volumes:
postgres_data:
driver: local
networks:
product-network:
driver: bridge