-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.local.yml
More file actions
87 lines (80 loc) · 2.13 KB
/
docker-compose.local.yml
File metadata and controls
87 lines (80 loc) · 2.13 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
# docker-compose.local.yml
version: '3.8'
services:
# PostgreSQL Database
db:
image: postgres:17
container_name: postgres
restart: on-failure:3 # Restart up to 3 times on failure
ports:
- 5435:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: taskcord
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 3s
timeout: 3s
retries: 10
volumes:
- postgres_data:/var/lib/postgresql/data
# Redis
redis:
container_name: redis
image: "redis:7-alpine"
command: redis-server /usr/local/etc/redis/redis.conf
volumes:
- ./.docker/redis/redis.conf:/usr/local/etc/redis/redis.conf:ro
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 5s
retries: 10
ports:
- 6385:6379
# # API Service
api:
container_name: taskcord-api
build:
context: .
dockerfile: ./Dockerfile.api
target: builder # Use builder stage (has source + node_modules)
# restart: on-failure
command: ["pnpm", "--filter", "api", "dev"] # Override CMD to run dev mode
ports:
- 4005:4005
volumes:
- ./apps/api:/app/apps/api # Mount only API source for hot reload
- ./packages:/app/packages # Mount packages for monorepo deps
- /app/node_modules # Prevent overwriting node_modules
env_file:
- ./.env.local
depends_on:
- db
- redis
# # Discord Bot Service
discord-bot:
container_name: discord-bot
build:
context: .
dockerfile: ./Dockerfile.dbot
target: builder
# restart: on-failure
command: ["pnpm", "--filter", "bot", "dev"] # Override CMD to run dev mode
volumes:
- ./apps/discord-bot:/app/apps/discord-bot # Mount only discord bot source for hot reload
- ./packages:/app/packages # Mount packages for monorepo deps
- /app/node_modules # Prevent overwriting node_modules
env_file:
- ./.env.local
depends_on:
- api
- redis
volumes:
postgres_data:
driver: local
redis_data:
driver: local
networks:
taskord: