-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
50 lines (48 loc) · 1.13 KB
/
docker-compose.yml
File metadata and controls
50 lines (48 loc) · 1.13 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
services:
db:
image: postgres:15
container_name: tradelane_db
environment:
POSTGRES_USER: tradelane_db
POSTGRES_PASSWORD: tradelane_db
POSTGRES_DB: tradelane_db
ports:
- "15434:5432"
volumes:
- postgres_tradelane:/var/lib/postgresql/data
networks:
- tradelane_project
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tradelane_db"]
interval: 5s
timeout: 2s
retries: 5
app:
build:
context: .
dockerfile: Dockerfile
image: tradelane-app:latest
container_name: tradelane-app
depends_on:
db:
condition: service_healthy
ports:
- "8111:8111"
volumes:
- ~/tradelane_UPLOADS:/app/uploads
networks:
- tradelane_project
environment:
- INIT_DB=${INIT_DB:-false}
command: >
sh -c "if [ \"$$INIT_DB\" = \"true\" ]; then
chmod +x /usr/local/bin/scripts/init-db.sh &&
bash -x /usr/local/bin/scripts/init-db.sh ||
{ echo 'DB initialization failed'; exit 1; };
fi &&
./app
"
volumes:
postgres_tradelane:
networks:
tradelane_project: