-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
96 lines (93 loc) · 2.02 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
version: "3.9"
volumes:
postgres_storage:
driver: local
networks:
app:
services:
app:
container_name: app
image: app:local
build:
context: .
dockerfile: ./Dockerfile
volumes:
- .:/app/
command: npm run dev
environment:
NODE_STAGE: ${NODE_STAGE}
PORT: ${PORT}
DATABASE_USER: ${DATABASE_USER}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_HOST: ${DATABASE_HOST}
DATABASE_PORT: ${DATABASE_PORT}
ports:
- "3256:3256"
depends_on:
postgres:
condition: service_healthy
adminer:
condition: service_started
healthcheck:
test: "apk add curl && curl http://localhost:3256/"
retries: 20
interval: 3s
timeout: 5s
start_period: 5s
networks:
- app
postgres:
container_name: postgres
image: "postgres:13"
restart: always
environment:
POSTGRES_PASSWORD: postgres
TZ: "Europe/Warsaw"
healthcheck:
test: 'pg_isready --username=postgres && psql --username=postgres -c "SELECT * FROM postgres.pg_catalog.pg_database;"'
retries: 20
interval: 3s
timeout: 5s
start_period: 5s
ports:
- "5432:5432"
volumes:
- ./db_init.sql:/docker-entrypoint-initdb.d/db_init.sql:ro
networks:
- app
adminer:
container_name: adminer
image: adminer
restart: always
depends_on:
- postgres
ports:
- 8080:8080
networks:
- app
js:
image: app:local
container_name: js
hostname: js
volumes:
- .:/app
ports:
- 5545:5545
env_file:
- .env
environment:
NODE_STAGE: ${NODE_STAGE}
PORT: ${PORT}
DATABASE_USER: ${DATABASE_USER}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_HOST: ${DATABASE_HOST}
DATABASE_PORT: ${DATABASE_PORT}
networks:
- app
depends_on:
app:
condition: service_healthy
links:
- app