mirror of https://github.com/mindoc-org/mindoc.git
1. 新增了 docker-compose 配置文件 docker-compose.yml
2.新增 docker-compose 配置项实例文件env-example 3. 新增了配置项设置,并调整了项目在容器中的目录pull/190/head
parent
e8b38500a6
commit
88c9f6b18e
|
@ -0,0 +1,21 @@
|
||||||
|
###########################################################
|
||||||
|
# General Setup
|
||||||
|
###########################################################
|
||||||
|
|
||||||
|
### Application Path ###################################################################################################
|
||||||
|
# Point to your code, will be available at `/var/www/mindoc`.
|
||||||
|
|
||||||
|
APPLICATION=../mindoc_volume/
|
||||||
|
|
||||||
|
### GLOBAL ENVIRONMENT #################################################################################################
|
||||||
|
|
||||||
|
### 数据库配置 ,如果你的数据库不在容器内或没有用 --link过 那必须要写外部数据库ip
|
||||||
|
MYSQL_PORT_3306_TCP_ADDR=192.168.4.25
|
||||||
|
MYSQL_PORT_3306_TCP_PORT=3306
|
||||||
|
MYSQL_INSTANCE_NAME=mindoc_db
|
||||||
|
MYSQL_USERNAME=root
|
||||||
|
MYSQL_PASSWORD=root
|
||||||
|
# expose port
|
||||||
|
HTTP_PORT=8181
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@ RUN cp /etc/apk/repositories /etc/apk/repositories.back && \
|
||||||
|
|
||||||
RUN apk add --update bash git make gcc g++
|
RUN apk add --update bash git make gcc g++
|
||||||
|
|
||||||
ADD . /go/src/github.com/lifei6671/mindoc
|
ADD . /var/www/mindoc
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/lifei6671/mindoc
|
WORKDIR /var/www/mindoc
|
||||||
|
|
||||||
RUN chmod +x start.sh
|
RUN chmod +x start.sh
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
### Applications Code Container #############################
|
||||||
|
|
||||||
|
applications:
|
||||||
|
image: tianon/true
|
||||||
|
volumes:
|
||||||
|
- ${APPLICATION}:/var/www/mindoc
|
||||||
|
|
||||||
|
### Workspace Utilities Container ###########################
|
||||||
|
|
||||||
|
mindoc:
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
env_file: .env
|
||||||
|
environment:
|
||||||
|
- MYSQL_PORT_3306_TCP_ADDR=${MYSQL_PORT_3306_TCP_ADDR}
|
||||||
|
- MYSQL_PORT_3306_TCP_PORT=${MYSQL_PORT_3306_TCP_PORT}
|
||||||
|
- MYSQL_INSTANCE_NAME=${MYSQL_INSTANCE_NAME}
|
||||||
|
- MYSQL_USERNAME=${MYSQL_USERNAME}
|
||||||
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||||
|
- HTTP_PORT=${HTTP_PORT}
|
||||||
|
ports:
|
||||||
|
- "${HTTP_PORT}:8181"
|
||||||
|
volumes_from:
|
||||||
|
- applications
|
||||||
|
tty: true
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
|
||||||
|
### Networks Setup ############################################
|
||||||
|
|
||||||
|
networks:
|
||||||
|
backend:
|
||||||
|
driver: "bridge"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
###########################################################
|
||||||
|
# General Setup
|
||||||
|
###########################################################
|
||||||
|
|
||||||
|
### Application Path ###################################################################################################
|
||||||
|
# Point to your code, will be available at `/var/www/mindoc`.
|
||||||
|
|
||||||
|
APPLICATION=../mindoc_volume/
|
||||||
|
|
||||||
|
### GLOBAL ENVIRONMENT #################################################################################################
|
||||||
|
|
||||||
|
### 数据库配置 ,如果你的数据库不在容器内或没有用 --link过 那必须要写外部数据库ip
|
||||||
|
MYSQL_PORT_3306_TCP_ADDR=192.168.4.25
|
||||||
|
MYSQL_PORT_3306_TCP_PORT=3306
|
||||||
|
MYSQL_INSTANCE_NAME=mindoc_db
|
||||||
|
MYSQL_USERNAME=root
|
||||||
|
MYSQL_PASSWORD=root
|
||||||
|
# expose port
|
||||||
|
HTTP_PORT=8181
|
||||||
|
|
||||||
|
|
6
start.sh
6
start.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
cd /go/src/github.com/lifei6671/mindoc/
|
cd /var/www/mindoc
|
||||||
|
|
||||||
if [ ! -f "conf/app.conf" ] ; then
|
if [ ! -f "conf/app.conf" ] ; then
|
||||||
cp conf/app.conf.example conf/app.conf
|
cp conf/app.conf.example conf/app.conf
|
||||||
|
@ -45,6 +45,6 @@ fi
|
||||||
|
|
||||||
sed -i 's/^runmode.*/runmode=prod/g' conf/app.conf
|
sed -i 's/^runmode.*/runmode=prod/g' conf/app.conf
|
||||||
|
|
||||||
/go/src/github.com/lifei6671/mindoc/mindoc_linux_amd64 install
|
/var/www/mindoc/mindoc_linux_amd64 install
|
||||||
|
|
||||||
/go/src/github.com/lifei6671/mindoc/mindoc_linux_amd64
|
/var/www/mindoc/mindoc_linux_amd64
|
Loading…
Reference in New Issue