-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
46 lines (42 loc) · 935 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
34
35
36
37
38
39
40
41
42
43
44
45
46
version: '3.9'
services:
app:
build:
context: ./app
container_name: app
entrypoint: sh -c "npm install && npm run start"
restart: always
ports:
- "3000:3000"
volumes:
- ./app:/usr/src/app
depends_on:
database:
condition: service_healthy
database:
image: postgres:16
container_name: database
restart: always
volumes:
- postgres_data:/var/lib/postgresql
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=mysecretpassword
- POSTGRES_DB=fullcycle
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U $$POSTGRES_USER" ]
interval: 5s
timeout: 10s
retries: 3
nginx:
build:
context: ./nginx
container_name: nginx
ports:
- "8080:80"
depends_on:
- app
volumes:
postgres_data:
driver: local