-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
55 lines (51 loc) · 1.11 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#Spins two containers, one with postgres and the other one with the nextjs app
services:
# Dependencies
postgres:
image: postgres
container_name: peoplez-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: peoplez
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
retries: 3
start_period: 30s
timeout: 10s
maildev:
image: maildev/maildev
container_name: peoplez-maildev
ports:
- "1080:1080"
- "1025:1025"
# Application
nextjs:
build:
context: .
dockerfile: Dockerfile
container_name: peoplez-nextjs
ports:
- "3000:3000"
volumes:
- .:/app
depends_on:
- postgres
# Migrations
migrations:
restart: "no"
command: "npm run db:docker"
build:
context: .
dockerfile: Dockerfile
container_name: peoplez-migrations
volumes:
- .:/app
- /app/node_modules
depends_on:
postgres:
condition:
service_healthy