-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
53 lines (50 loc) · 1.29 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
version: "3"
services:
app:
container_name: schedula_tutorial
image: schedula/tutorial
build:
context: .
target: production
dockerfile: ./Dockerfile
volumes:
- ".:/code/"
ports:
- "3004:3000"
environment:
- ENVIRONMENT=DEVELOPMENT
- NODE_ENV=DEVELOPMENT
- DATABASE_HOST=postgres
- DATABASE_USER=postgres
- DATABASE_PASS=postgres
- DATABASE_DB=schedula_tutorial
- DATABASE_PORT=5432
depends_on:
- pgadmin
postgres:
image: postgres:12-alpine
container_name: schedula_tutorial_db
ports:
- "5106:5432"
volumes:
- ./.ignore/postgres/postgres:/var/lib/postgresql/data
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=schedula_tutorial
healthcheck:
# Run command inside the container to check if postgres is ready AND alter DATABASE_DB
test: ["CMD-SHELL", "sh -c 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB'"]
interval: 5s
timeout: 5s
retries: 5
pgadmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: "[email protected]"
PGADMIN_DEFAULT_PASSWORD: "schedula123!"
ports:
- "16546:80"
depends_on:
postgres:
condition: service_healthy