-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
57 lines (53 loc) · 1.8 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
version: '3'
services:
mysql:
build:
context: ./src/main/resources/db
container_name: mysql-container
command:
--default-authentication-plugin=mysql_native_password --general-log=1 --general-log-file=/var/log/mysql/general-log.log --slow_query_log=1 --slow_query_log_file=/var/log/mysql/slow-query-log.log
volumes:
- type: bind
# Use user-defined volume so mysql data is persisted across restart and accessible on host
source: ./src/main/resources/db/data
target: /var/lib/mysql
read_only: false
- type: bind
# Logs are mounted to a relative path. These are also accessed by Filebeat and consumed by the Mysql module
source: ./src/main/resources/db/logs
target: /var/log/mysql
ports:
- 3306:3306
networks:
- "default"
adminer:
image: adminer
container_name: adminer-container
ports:
- 8081:8080
networks:
- default
algamoney-api:
build:
context: ./
container_name: algamoney-api-container
ports:
- 8080:8080
environment:
spring.datasource.url: jdbc:mysql://mysql-container:3306/algamoneyapi?createDatabaseIfNotExist=true&useSSL=false&useTimezone=true&serverTimezone=UTC
networks:
- default
depends_on:
- mysql
restart: on-failure
networks:
# Using an external user-defined network, already created before
# "default" => visible internally only, used by internals containers that don't see the external network
# "algamoney-network" => visible by others containers created externally to this
default:
external:
name: algamoney-network
# Using a default network dynamically created by docker, used by internals containers only
# Pattern => dirName_algamoney-network
# algamoney-network:
# driver: bridge