-
Notifications
You must be signed in to change notification settings - Fork 13
/
docker-compose.yml
78 lines (73 loc) · 2.09 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
version: '3.8'
networks:
outside-nw:
services:
database:
image: 'mysql:8.0.21'
environment:
MYSQL_ROOT_PASSWORD: r00t
MYSQL_ROOT_HOST: '%'
MYSQL_DATABASE: testdb
MYSQL_USER: testdbuser
MYSQL_PASSWORD: dummyPass!
ports:
- '3306:3306'
volumes:
- ~/data/mysql8:/var/lib/mysql
networks:
- outside-nw
# healthcheck:
# test: mysql --user $$MYSQL_USER --password=$$MYSQL_PASSWORD --database $$MYSQL_DATABASE --execute "select 1;"
# interval: 30s
# timeout: 10s
# retries: 3
# start_period: 15s
application:
build:
context: .
dockerfile: ./docker/Dockerfile.app-exploded
ports:
- 8080
- 5701
environment:
SPRING_DATASOURCE_URL: 'jdbc:mysql://database:3306/testdb'
SPRING_DATASOURCE_USERNAME: testdbuser
SPRING_DATASOURCE_PASSWORD: dummyPass!
SPRING_FLYWAY_URL: 'jdbc:mysql://database:3306/testdb'
SPRING_FLYWAY_USER: testdbuser
SPRING_FLYWAY_PASSWORD: dummyPass!
networks:
- outside-nw
depends_on:
- database
restart: unless-stopped
labels:
- traefik.enable=true
- traefik.http.routers.application.rule=Host(`dev-sandbox`)
- traefik.http.services.application.loadbalancer.server.port=8080
load-balancer:
image: 'traefik:v2.3'
command: >
--providers.docker=true
--providers.docker.exposedbydefault=false
--entryPoints.http.address=":80"
--accesslog
--log.level=INFO
--api=true
--api.insecure=true
--api.dashboard=true
ports:
- "80:80" # load balancer port
- "8080:8080" # management UI
volumes:
# traefik does its magic by reading information about running containers from the docker socket
- "/var/run/docker.sock:/var/run/docker.sock:ro"
networks:
- outside-nw
depends_on:
- application
labels:
- traefik.enable=true
- traefik.http.routers.traefik_http.rule=Host(`dev-sandbox`)
- traefik.http.routers.traefik_http.service=api@internal
- traefik.http.routers.traefik_http.entrypoints=http