Feat: add docker-compose

This commit is contained in:
1ch0
2022-12-03 08:27:24 +08:00
parent f15c45793b
commit f2119b2c52
4 changed files with 853 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
version: "3.9"
services:
mysql:
image: "mysql:5.7"
container_name: mayfly-go-mysql
environment:
MYSQL_ROOT_PASSWORD: 111049
MYSQL_DATABASE: mayfly-go
TZ: Asia/Shanghai
volumes:
- ./docs/docker-compose/mysql/data/mydir:/mydir
- ./docs/docker-compose/mysql/data/datadir:/var/lib/mysql
# 在宿主机编写 /apps/mysql/conf/my.cnf
- ./docs/docker-compose/mysql/my.cnf:/etc/my.cnf
# 数据库还原目录 可将需要还原的sql文件放在这里
- ./docs/docker-compose/mysql/init:/docker-entrypoint-initdb.d
restart: always
server:
image: mayfly-go:v1.3.0
build:
context: .
dockerfile: Dockerfile
container_name: mayfly-go-server
ports:
- "8888:8888"
environment:
TZ: Asia/Shanghai
WAIT_HOSTS: mysql:3306
depends_on:
- mysql
restart: always