2021-04-25 15:18:33 +08:00
|
|
|
FROM golang:1.15 AS build
|
2020-11-11 08:54:47 +08:00
|
|
|
|
|
|
|
WORKDIR /opt/ferry
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2021-04-13 11:32:34 +08:00
|
|
|
ARG GOPROXY="https://goproxy.cn"
|
2020-11-11 08:54:47 +08:00
|
|
|
|
|
|
|
RUN go mod download
|
|
|
|
RUN go build -o ferry .
|
|
|
|
|
2021-04-13 11:32:34 +08:00
|
|
|
|
|
|
|
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/
|
2021-04-25 14:55:11 +08:00
|
|
|
COPY docker/entrypoint.sh /opt/ferry/
|
2021-04-13 11:32:34 +08:00
|
|
|
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" ]
|