-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
35 lines (33 loc) 路 884 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
35 lines (33 loc) 路 884 Bytes
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
services:
# --- THE DATABASE ---
db:
image: postgres:16-alpine
container_name: jukeboxd_postgres
restart: always
environment:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_DB: jukeboxd_dev
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
# --- YOUR NEXT.JS APP ---
web:
build: .
container_name: jukeboxd_web_app
ports:
- "3000:3000"
environment:
# Overrides .env inside the container so it talks to the 'db' container
DATABASE_URL: postgres://myuser:mysecretpassword@db:5432/jukeboxd_dev
volumes:
- .:/app
- /app/node_modules
- /app/.next
depends_on:
- db
# Prisma syncs your schema to the database first, then Next.js starts
command: sh -c "npx prisma db push && npm run dev"
volumes:
postgres_data: