Merge pull request #304 from ehlxr/master

更新 Dockerfile 适配使用 MySQL 数据源
pull/358/head
Minho 2018-06-27 17:22:03 +08:00 committed by GitHub
commit 01084c7b0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View File

@ -19,6 +19,7 @@ FROM alpine:latest
LABEL maintainer="ehlxr.me@gmail.com"
WORKDIR /mindoc
COPY --from=0 /go/src/github.com/lifei6671/mindoc .
ENV ZONEINFO=/mindoc/lib/time/zoneinfo.zip
RUN chmod +x start.sh
CMD ["./start.sh"]

View File

@ -113,6 +113,7 @@ mail_expired=30
在启动镜像时需要提供如下的环境变量:
```ini
DB_ADAPTER 制定 DB
MYSQL_PORT_3306_TCP_ADDR MySQL地址
MYSQL_PORT_3306_TCP_PORT MySQL端口号
MYSQL_INSTANCE_NAME MySQL数据库名称
@ -124,7 +125,7 @@ HTTP_PORT 程序监听的端口号
举个栗子
```bash
docker run -p 8181:8181 -e MYSQL_PORT_3306_TCP_ADDR=127.0.0.1 -e MYSQL_PORT_3306_TCP_PORT=3306 -e MYSQL_INSTANCE_NAME=mindoc_db -e MYSQL_USERNAME=root -e MYSQL_PASSWORD=123456 -e httpport=8181 -d daocloud.io/lifei6671/mindoc:latest
docker run -p 8181:8181 --name mindoc -e DB_ADAPTER=mysql -e MYSQL_PORT_3306_TCP_ADDR=10.xxx.xxx.xxx -e MYSQL_PORT_3306_TCP_PORT=3306 -e MYSQL_INSTANCE_NAME=mindoc -e MYSQL_USERNAME=root -e MYSQL_PASSWORD=123456 -e httpport=8181 -d daocloud.io/lifei6671/mindoc:latest
```
### docker-compose 一键安装
1. 生成配置文件