-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdocker-compose.local.yml
More file actions
61 lines (58 loc) · 1.78 KB
/
Copy pathdocker-compose.local.yml
File metadata and controls
61 lines (58 loc) · 1.78 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
services:
postgres:
image: postgres:15-alpine
container_name: tea_postgres_dev
environment:
POSTGRES_DB: tea_dev
POSTGRES_USER: tea_user
POSTGRES_PASSWORD: tea_password
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- tea_dev_network
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U tea_user -d tea_dev']
interval: 10s
timeout: 5s
retries: 5
tea_app:
build:
context: .
dockerfile: Dockerfile.dev
container_name: tea_app_dev
ports:
- '3000:3000'
depends_on:
postgres:
condition: service_healthy
env_file:
- ./.env
environment:
# Override DATABASE_URL to use Docker network hostname
- DATABASE_URL=postgresql://tea_user:tea_password@postgres:5432/tea_dev
# Increase Node.js memory limit for Next.js dev server
- NODE_OPTIONS=--max-old-space-size=4096
volumes:
- .:/app
- app_next:/app/.next
- node_modules_dev:/app/node_modules
networks:
- tea_dev_network
# Memory limit (requires docker-compose v2)
mem_limit: 6g
memswap_limit: 6g
# Run in production mode to avoid Nextra dev compilation crashes
# For hot reload, run `pnpm dev` on localhost instead
command:
sh -c "npx prisma migrate deploy && npx tsx prisma/seed/dev-seed.ts && if [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build && pnpm start; else npm run build && npm start; fi"
networks:
tea_dev_network:
driver: bridge
volumes:
postgres_data:
app_next:
# Named volume for container's node_modules (Linux binaries, separate from host's macOS binaries)
# Clear when dependencies change: docker volume rm assuranceplatform_node_modules_dev
node_modules_dev: