-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
111 lines (104 loc) · 3.05 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
services:
traefik:
image: traefik:v2.10
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
ports:
- "80:80"
- "443:443"
- "8090:8080" # Traefik dashboard
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
networks:
- app-network
backend:
build:
context: ./backend
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=Host(`${DOMAIN_BACKEND}`)"
- "traefik.http.services.backend.loadbalancer.server.port=8080"
environment:
- SPRING_DATASOURCE_URL=${SPRING_DATASOURCE_URL}
- SPRING_DATASOURCE_USERNAME=${SPRING_DATASOURCE_USERNAME}
- SPRING_DATASOURCE_PASSWORD=${SPRING_DATASOURCE_PASSWORD}
- SPRING_JPA_HIBERNATE_DDL_AUTO=${SPRING_JPA_HIBERNATE_DDL_AUTO}
- SPRING_JPA_SHOW_SQL=${SPRING_JPA_SHOW_SQL}
- SPRING_JPA_FORMAT_SQL=${SPRING_JPA_FORMAT_SQL}
depends_on:
mariadb:
condition: service_healthy
liquibase:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app-network
frontend:
build:
context: ./frontend
target: development
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.rule=Host(`${DOMAIN_FRONTEND}`)"
- "traefik.http.services.frontend.loadbalancer.server.port=4200"
ports:
- '4200:4200'
networks:
- app-network
mariadb:
image: mariadb:10.11
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- '3306:3306'
volumes:
- mariadb_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p$$MYSQL_ROOT_PASSWORD"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app-network
liquibase:
image: liquibase/liquibase:latest
depends_on:
mariadb:
condition: service_healthy
environment:
- LIQUIBASE_COMMAND_USERNAME=${LIQUIBASE_COMMAND_USERNAME}
- LIQUIBASE_COMMAND_PASSWORD=${LIQUIBASE_COMMAND_PASSWORD}
- LIQUIBASE_COMMAND_URL=${LIQUIBASE_COMMAND_URL}
- LIQUIBASE_SEARCH_PATH=${LIQUIBASE_SEARCH_PATH}
- LIQUIBASE_COMMAND_CHANGELOG_FILE=${LIQUIBASE_COMMAND_CHANGELOG_FILE}
volumes:
- ./liquibase:/liquibase/changelog
command: update
networks:
- app-network
adminer:
image: adminer:latest
labels:
- "traefik.enable=true"
- "traefik.http.routers.adminer.rule=Host(`${DOMAIN_ADMINER}`)"
- "traefik.http.services.adminer.loadbalancer.server.port=8080"
depends_on:
- mariadb
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
mariadb_data: