-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
64 lines (63 loc) · 1.68 KB
/
docker-compose.yaml
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
version: '3.1'
services:
db:
image: postgres:latest
container_name: qb-database
ports:
- "5432:5432"
networks:
- subnetwork
volumes:
- .pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U question_bank"]
interval: 5s
timeout: 5s
retries: 5
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- PGDATA=/var/lib/postgresql/data/pgdata
migration:
image: flyway/flyway:latest
container_name: qb-migration
networks:
- subnetwork
command: -locations=filesystem:/flyway/sql -connectRetries=60 migrate
volumes:
- ./migration:/flyway/sql
depends_on:
db:
condition: service_healthy
environment:
- FLYWAY_USER=${POSTGRES_USER}
- FLYWAY_PASSWORD=${POSTGRES_PASSWORD}
- FLYWAY_URL=jdbc:postgresql://${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
web-app:
build:
context: .
dockerfile: Dockerfile
container_name: application
ports:
- "8080:8080"
- "4848:4848"
environment:
- GLASSFISH_ADMIN_PASSWORD=${GLASSFISH_ADMIN_PASSWORD}
- APPLICATION_CONTEXT_ROOT=${APPLICATION_CONTEXT_ROOT}
- DB_HOST=${POSTGRES_HOST}
- DB_PORT=${POSTGRES_PORT}
- DB_USER=${POSTGRES_USER}
- DB_PASSWORD=${POSTGRES_PASSWORD}
- DB_NAME=${POSTGRES_DB}
volumes:
- /tmp/qb/logs:/tmp/logs
- /tmp/qb/logs/server:/opt/glassfish7/glassfish/domains/domain1/logs
networks:
- subnetwork
depends_on:
db:
condition: service_healthy
restart: on-failure
networks:
subnetwork: