-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
33 lines (30 loc) · 1004 Bytes
/
docker-compose.yml
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
version: '3.8'
services:
postgres:
image: postgres:14
container_name: postgres_db
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin123
POSTGRES_DB: erp_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-scripts:/docker-entrypoint-initdb.d # Add initialization scripts if needed
restart: unless-stopped # Restart PostgreSQL container in case of failure
nextjs:
build:
context: . # Build context is the root of the project
dockerfile: cap/Dockerfile # Specify the path to the Dockerfile inside the 'cap' folder
container_name: nextjs_app
ports:
- "3000:3000"
environment:
DATABASE_URL: postgres://admin:admin123@postgres:5432/erp_db
volumes:
- ./cap:/app # Mount the 'cap' folder to '/app' inside the container
depends_on:
- postgres # Ensure Next.js starts after PostgreSQL, but still needs a wait script
volumes:
postgres_data: