-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yaml
More file actions
94 lines (84 loc) · 2.38 KB
/
docker-compose.prod.yaml
File metadata and controls
94 lines (84 loc) · 2.38 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
services:
app:
image: ${DOCKER_USERNAME}/trackmoney:${IMAGE_TAG:-latest}
container_name: trackmoney-app
restart: unless-stopped
ports:
- "${APP_PORT:-8080}:8080"
environment:
# Database Configuration
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/${POSTGRES_DB}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD}
# Redis Configuration
SPRING_REDIS_HOST: redis
SPRING_REDIS_PORT: 6379
# Mail Configuration
SPRING_MAIL_HOST: ${SPRING_MAIL_HOST}
SPRING_MAIL_PORT: ${SPRING_MAIL_PORT}
SPRING_MAIL_USERNAME: ${SPRING_MAIL_USERNAME}
SPRING_MAIL_PASSWORD: ${SPRING_MAIL_PASSWORD}
# Security Configuration
API_SECRET_KEY: ${API_SECRET_KEY}
# Frontend URL
FRONT_URL: ${FRONT_URL}
# Server Configuration
SERVER_CONTEXT_PATH: ${SERVER_CONTEXT_PATH:-/api/v1}
# Spring Profile
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE:-prod}
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
networks:
- app-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/api/v1/actuator/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
db:
image: postgres:16.8-alpine
container_name: trackmoney-db
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: trackmoney-redis
restart: unless-stopped
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
networks:
- app-network
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
networks:
app-network:
driver: bridge
volumes:
postgres_data:
driver: local
redis_data:
driver: local