-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #159 from eahomliu/master
新增docker部署
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM alpine/git | ||
|
||
ENV TZ=Asia/Shanghai | ||
|
||
WORKDIR /app | ||
|
||
RUN git clone https://github.com/phachon/mm-wiki.git | ||
|
||
|
||
FROM golang:1.14.1-alpine | ||
|
||
COPY --from=0 /app/mm-wiki /app/mm-wiki | ||
|
||
WORKDIR /app/mm-wiki | ||
|
||
# 如果国内网络不好,可添加以下环境 | ||
# RUN go env -w GO111MODULE=on | ||
# RUN go env -w GOPROXY=https://goproxy.cn,direct | ||
# RUN export GO111MODULE=on | ||
# RUN export GOPROXY=https://goproxy.cn | ||
|
||
RUN mkdir /opt/mm-wiki && ls /app/mm-wiki | ||
RUN go build -o /opt/mm-wiki/mm-wiki ./ \ | ||
&& cp -r ./conf/ /opt/mm-wiki \ | ||
&& cp -r ./install/ /opt/mm-wiki\ | ||
&& cp ./scripts/run.sh /opt/mm-wiki\ | ||
&& cp -r ./static/ /opt/mm-wiki\ | ||
&& cp -r ./views/ /opt/mm-wiki\ | ||
&& cp -r ./logs/ /opt/mm-wiki\ | ||
&& cp -r ./docs/ /opt/mm-wiki | ||
CMD ["/opt/mm-wiki/mm-wiki", "--conf", "/opt/mm-wiki/conf/mm-wiki.conf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters