-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.database.yml
More file actions
59 lines (55 loc) · 1.58 KB
/
docker-compose.database.yml
File metadata and controls
59 lines (55 loc) · 1.58 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
# Database services configuration
# Includes PostgreSQL, pgAdmin, and Redis
# Usage: docker-compose -f docker-compose.yml -f docker-compose.database.yml up
version: '3.8'
services:
postgres:
image: postgres:15-alpine
container_name: bakery_postgres
environment:
POSTGRES_DB: ${POSTGRES_DB:-bakery_db}
POSTGRES_USER: ${POSTGRES_USER:-bakery_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-bakery_pass}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- ./docker/volumes/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-bakery_user} -d ${POSTGRES_DB:-bakery_db}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- bakery_network
restart: unless-stopped
pgadmin:
image: dpage/pgadmin4:latest
container_name: bakery_pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-admin@bakery.com}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
ports:
- "${PGADMIN_PORT:-5050}:80"
volumes:
- ./docker/volumes/pgadmin:/var/lib/pgadmin
depends_on:
- postgres
networks:
- bakery_network
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: bakery_redis
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- ./docker/volumes/redis:/data
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- bakery_network
restart: unless-stopped