forked from lanyulei/ferry
-
Notifications
You must be signed in to change notification settings - Fork 0
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 lanyulei#178 from lanyulei/dev
fix: 优化docker构建方式。
- Loading branch information
Showing
12 changed files
with
63 additions
and
1,623 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 |
---|---|---|
|
@@ -8,4 +8,5 @@ tmp/ | |
config/settings.dev.yml | ||
logs | ||
mysql/data | ||
redis/data | ||
redis/data | ||
data/ |
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 |
---|---|---|
@@ -1,12 +1,28 @@ | ||
FROM golang:1.14 | ||
FROM golang:1.16 AS build | ||
|
||
WORKDIR /opt/ferry | ||
|
||
COPY . . | ||
|
||
ENV GOPROXY="https://goproxy.cn" | ||
ARG GOPROXY="https://goproxy.cn" | ||
|
||
RUN go mod download | ||
RUN go build -o ferry . | ||
|
||
EXPOSE 8002 | ||
|
||
FROM debian:buster AS prod | ||
|
||
WORKDIR /opt/ferry | ||
|
||
COPY --from=build /opt/ferry/ferry /opt/ferry/ | ||
COPY config/ /opt/ferry/default_config/ | ||
COPY template/ /opt/ferry/template/ | ||
COPY entrypoint.sh /opt/ferry/ | ||
RUN mkdir -p logs static/uploadfile static/scripts static/template | ||
|
||
RUN chmod 755 /opt/ferry/entrypoint.sh | ||
RUN chmod 755 /opt/ferry/ferry | ||
|
||
EXPOSE 8002 | ||
VOLUME [ "/opt/ferry/config" ] | ||
ENTRYPOINT [ "/opt/ferry/entrypoint.sh" ] |
Empty file.
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.