-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
54 lines (53 loc) · 1.35 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
version: "2.1"
services:
shortener:
build:
context: .
dockerfile: ./Dockerfile
restart: always
networks:
- shortener
container_name: shortener_app
environment:
STORAGE: mysql
MYSQL_HOST: mariadb
MYSQL_DBNAME: shortener_db
MYSQL_USER: shortener
MYSQL_PASSWORD: '12345678'
ports:
- "31456:8080"
mariadb:
image: mariadb:10.5.5
restart: always
networks:
- shortener
container_name: shortener_mariadb
environment:
MYSQL_ROOT_PASSWORD: '12345678'
MYSQL_USER: 'shortener'
MYSQL_PASSWORD: '12345678'
MYSQL_DATABASE: 'shortener_db'
volumes:
- mariadbdata:/var/lib/mysql
# ports:
# - "3307:3306"
shortener_init:
build:
context: .
dockerfile: ./Dockerfile
networks:
- shortener
container_name: shortener_init
environment:
MYSQL_HOST: mariadb
MYSQL_DBNAME: shortener_db
MYSQL_USER: shortener
MYSQL_PASSWORD: '12345678'
tty: true
command: ['init-storage']
networks:
shortener:
driver: bridge
volumes:
mariadbdata:
driver: local