-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (44 loc) · 1.13 KB
/
docker-compose.yml
File metadata and controls
46 lines (44 loc) · 1.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
services:
app:
build: .
ports:
- "3000:3000"
volumes:
- .:/app
- /app/node_modules
- /app/.next
environment:
DATABASE_URL: postgresql://postgres:postgres@db:5432/networth
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-dev-secret-change-in-production}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
DISABLE_AUTH: ${DISABLE_AUTH:-true}
depends_on:
db:
condition: service_healthy
# Push schema and start dev server
command: >
sh -c "
echo 'Waiting for database...' &&
npx prisma db push --accept-data-loss &&
echo 'Database ready!' &&
npm run dev
"
db:
image: postgres:15
ports:
- "54322:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: networth
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d networth"]
interval: 5s
timeout: 5s
retries: 10
volumes:
postgres_data: