forked from ArthurEnrique15/adote-facil
-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (55 loc) · 1.42 KB
/
docker-compose.yml
File metadata and controls
59 lines (55 loc) · 1.42 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
47
48
49
50
51
52
53
54
55
56
57
58
59
services:
adote-facil-postgres:
image: postgres:14-alpine
container_name: 'adote-facil-postgres'
env_file:
- ./backend/.env
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_CONTAINER_PORT: ${POSTGRES_CONTAINER_PORT}
ports:
- ${POSTGRES_CONTAINER_PORT}:5432
volumes:
- db_data:/var/lib/postgresql/data
networks:
- adote-facil-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 3s
timeout: 3s
retries: 5
adote-facil-backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: 'adote-facil-backend'
ports:
- "8080:8080"
environment:
- NODE_ENV=production
depends_on:
adote-facil-postgres:
condition: service_healthy
command: sh -c "until nc -z adote-facil-postgres 5432; do echo 'Waiting for postgres...'; sleep 1; done; npm start"
networks:
- adote-facil-network
adote-facil-frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: 'adote-facil-frontend'
ports:
- "3000:3000"
environment:
- NODE_ENV=production
depends_on:
- adote-facil-backend
networks:
- adote-facil-network
volumes:
db_data:
networks:
adote-facil-network:
driver: bridge