-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
82 lines (76 loc) · 1.99 KB
/
docker-compose.yml
File metadata and controls
82 lines (76 loc) · 1.99 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
version: "3.9"
services:
app:
build: .
container_name: skillswap-app
ports:
- "8080:8080"
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/${POSTGRES_DB:-skillswap}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER:-postgres}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
SPRING_JPA_HIBERNATE_DDL_AUTO: none
SPRING_REDIS_HOST: redis
SPRING_REDIS_PORT: 6379
SPRING_MAIL_HOST: mailhog
SPRING_MAIL_PORT: 1025
SPRING_PROFILES_ACTIVE: docker
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
mailhog:
condition: service_started
networks:
- skillswap-net
restart: always
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8080/actuator/health || exit 1"]
interval: 30s
timeout: 10s
retries: 5
db:
image: postgres:16
container_name: skillswap-db
environment:
POSTGRES_DB: ${POSTGRES_DB:-skillswap}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./src/main/resources/schema.sql:/docker-entrypoint-initdb.d/schema.sql # Auto-create schema on first startup
networks:
- skillswap-net
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-skillswap}"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7.2
container_name: skillswap-redis
ports:
- "6379:6379"
volumes:
- redisdata:/data
networks:
- skillswap-net
restart: always
mailhog:
image: mailhog/mailhog
container_name: skillswap-mailhog
ports:
- "8025:8025" # Access via http://localhost:8025
networks:
- skillswap-net
restart: always
networks:
skillswap-net:
driver: bridge
volumes:
pgdata:
redisdata: