-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
89 lines (83 loc) · 2.23 KB
/
docker-compose.dev.yml
File metadata and controls
89 lines (83 loc) · 2.23 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
# Auth Service - Development Docker Compose
# Usage: docker compose -f docker-compose.dev.yml up -d
# Note: This only starts infrastructure services, not the app (use go run or air for hot reload)
services:
auth-postgres:
image: postgres:16-alpine
container_name: ${COMPOSE_PROJECT_NAME:-auth}-postgres
env_file:
- .env
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-auth_db}
ports:
- "${POSTGRES_PORT:-5433}:5432"
volumes:
- auth-postgres-data:/var/lib/postgresql/data
- ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init.sql:ro
networks:
- auth-dev-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-auth_db}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
auth-redis:
image: redis:7-alpine
container_name: ${COMPOSE_PROJECT_NAME:-auth}-redis
command: >
redis-server
--appendonly yes
--maxmemory 256mb
--maxmemory-policy allkeys-lru
ports:
- "${REDIS_PORT:-6380}:6379"
volumes:
- auth-redis-data:/data
networks:
- auth-dev-network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
# Optional: Adminer for database management in development
adminer:
image: adminer:latest
container_name: ${COMPOSE_PROJECT_NAME:-auth}-adminer
ports:
- "8081:8080"
networks:
- auth-dev-network
depends_on:
- auth-postgres
profiles:
- tools
# Optional: Redis Commander for Redis management
redis-commander:
image: rediscommander/redis-commander:latest
container_name: ${COMPOSE_PROJECT_NAME:-auth}-redis-commander
environment:
REDIS_HOSTS: local:auth-redis:6379
ports:
- "8082:8081"
networks:
- auth-dev-network
depends_on:
- auth-redis
profiles:
- tools
volumes:
auth-postgres-data:
driver: local
auth-redis-data:
driver: local
networks:
auth-dev-network:
driver: bridge
name: minisource-dev