-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.local.yml
More file actions
78 lines (73 loc) · 1.82 KB
/
Copy pathdocker-compose.local.yml
File metadata and controls
78 lines (73 loc) · 1.82 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
services:
postgres:
image: postgres:15-alpine
container_name: diary-postgres-local
environment:
POSTGRES_USER: diary_user
POSTGRES_PASSWORD: diary_password
POSTGRES_DB: diary_db
ports:
- "5433:5432"
volumes:
- postgres_data_local:/var/lib/postgresql/data
networks:
- diary-network-local
healthcheck:
test: ["CMD-SHELL", "pg_isready -U diary_user"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: diary-redis-local
ports:
- "6380:6379"
volumes:
- redis_data_local:/data
networks:
- diary-network-local
backend:
build: ./backend
container_name: diary-backend-local
ports:
- "8011:8011"
environment:
- DATABASE_URL=postgresql://diary_user:diary_password@postgres:5432/diary_db
- REDIS_URL=redis://redis:6379/0
- SECRET_KEY=dev-secret-key-local-12345
- CORS_ORIGINS=http://localhost:3011
- ENVIRONMENT=development
- DEBUG=True
volumes:
- ./backend:/app
depends_on:
postgres:
condition: service_healthy
networks:
- diary-network-local
command: uvicorn app.main:app --host 0.0.0.0 --port 8011 --reload
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: diary-frontend-local
ports:
- "3011:3011"
environment:
- NEXT_PUBLIC_API_URL=http://localhost:8011
- NEXT_PUBLIC_APP_URL=http://localhost:3011
volumes:
- ./frontend:/app
- /app/node_modules
- /app/.next
depends_on:
- backend
networks:
- diary-network-local
command: sh -c "pnpm install && pnpm run dev -p 3011 -H 0.0.0.0"
networks:
diary-network-local:
driver: bridge
volumes:
postgres_data_local:
redis_data_local: