From 4392bc88a4d312fa5419cf13192bcfcec86477c5 Mon Sep 17 00:00:00 2001 From: Hcreak Date: Tue, 17 Oct 2023 02:56:02 +0800 Subject: [PATCH] Add run container --- Dockerfile | 14 ++++++++++++++ run.sh | 3 +++ 2 files changed, 17 insertions(+) create mode 100644 run.sh diff --git a/Dockerfile b/Dockerfile index bda3d61..1f87bfa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,3 +6,17 @@ ADD . . RUN go mod init github.com/coyove/goflyway RUN go mod tidy RUN go build ./cmd/goflyway + +FROM alpine:3.18 + +WORKDIR /opt +COPY --from=go-build build/goflyway . +COPY --from=go-build build/chinalist.txt . +ADD run.sh . + +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN chmod +x run.sh + +EXPOSE 1081 +EXPOSE 1091 +CMD ["./run.sh"] diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..c8965f9 --- /dev/null +++ b/run.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +./goflyway $GLOBAL_FLAG -up="ws://$UP" -k="$KEY" -l="0.0.0.0:1081" -web-port="1091"