-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
60 lines (52 loc) · 1.71 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
services:
postgres:
build:
context: services/postgresql
dockerfile: db.dockerfile
restart: 'unless-stopped'
environment:
POSTGRES_PASSWORD: postgres
APP_POSTGRES_USERNAME: '${APP_POSTGRES_USERNAME:-stud}'
APP_POSTGRES_PASSWORD: '${APP_POSTGRES_PASSWORD:-password}'
APP_POSTGRES_DATABASE: '${APP_POSTGRES_DATABASE:-laba}'
ports:
- '${POSTGRES_PORT:-5432}:5432'
volumes:
- './services/postgresql/entrypoint/:/docker-entrypoint-initdb.d'
- 'postgres-data:/var/lib/postgresql/data'
liquibase:
build:
context: services/liquibase
dockerfile: lq.dockerfile
depends_on:
- postgres
restart: 'on-failure'
environment:
LIQUIBASE_COMMAND_USERNAME: '${APP_POSTGRES_USERNAME:-stud}'
LIQUIBASE_COMMAND_PASSWORD: '${APP_POSTGRES_PASSWORD:-password}'
LIQUIBASE_COMMAND_URL: 'jdbc:postgresql://postgres:5432/${APP_POSTGRES_DATABASE:-laba}'
volumes:
- './services/liquibase/changelog:/liquibase/changelog'
- './services/liquibase/config:/liquibase/config'
command: '--defaults-file=/liquibase/config/liquibase.properties update'
application:
profiles: ["application"]
build:
context: .
dockerfile: backend-from-jar.dockerfile
restart: always
environment:
APP_POSTGRES_HOST: postgres
APP_POSTGRES_USERNAME: '${APP_POSTGRES_USERNAME:-stud}'
APP_POSTGRES_PASSWORD: '${APP_POSTGRES_PASSWORD:-password}'
APP_POSTGRES_DATABASE: '${APP_POSTGRES_DATABASE:-laba}'
APP_POSTGRES_PORT: 5432
APP_PORT: 8871
ports:
- "${APP_PORT:-8871}:8871"
command: 'java -jar application.jar'
volumes:
postgres-data:
networks:
default:
driver: bridge