-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
140 lines (133 loc) · 3.22 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
140 lines (133 loc) · 3.22 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=https://hyperbach-api.ngrok.io/api/v1
- NEXT_PUBLIC_WS_URL=wss://hyperbach-api.ngrok.io/api/v1
- NEXTAUTH_URL=http://localhost:3000
- NEXTAUTH_SECRET=dev-secret-please-change
- NODE_ENV=development
volumes:
- ./frontend:/app
- /app/node_modules
- /app/.next
networks:
- app-network
ngrok:
image: ngrok/ngrok:latest
ports:
- "4040:4040"
environment:
- NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN}
command:
- "start"
- "--config"
- "/etc/ngrok.yml"
- "frontend"
- "backend"
volumes:
- ./ngrok.yml:/etc/ngrok.yml:ro
networks:
- app-network
depends_on:
- frontend
- backend
backend:
build:
context: ./backend
dockerfile: Dockerfile.dev
ports:
- "8000:8000"
volumes:
- ./backend:/app
- backend_logs:/app/logs
- ./certs:/certs
environment:
- POSTGRES_SERVER=db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=hyperbach
- SECRET_KEY=dev-secret-key-please-change
- OPENAI_API_KEY=${OPENAI_API_KEY}
- SPOTIFY_CLIENT_ID=${SPOTIFY_CLIENT_ID}
- SPOTIFY_CLIENT_SECRET=${SPOTIFY_CLIENT_SECRET}
- LASTFM_API_KEY=${LASTFM_API_KEY}
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
executor:
condition: service_started
networks:
- app-network
restart: unless-stopped
executor:
build:
context: ./executor
dockerfile: Dockerfile
expose:
- "8080" # Only exposed within the Docker network
environment:
- SPOTIFY_CLIENT_ID=${SPOTIFY_CLIENT_ID}
- SPOTIFY_CLIENT_SECRET=${SPOTIFY_CLIENT_SECRET}
volumes:
- ./executor:/app # Mount for development to enable hot reload
command: uvicorn app:app --host 0.0.0.0 --port 8080 --reload --workers 4 # Enable hot reload
networks:
- app-network
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
cpus: '2.0'
db:
image: postgres:16-alpine
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=hyperbach
- POSTGRES_MAX_CONNECTIONS=200
- POSTGRES_SHARED_BUFFERS=256MB
command: postgres -c max_connections=200 -c shared_buffers=256MB
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- app-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
postgres_data:
redis_data:
frontend_node_modules:
frontend_next_cache:
backend_logs:
networks:
app-network:
name: dev_app_network
driver: bridge