|
@@ -2,23 +2,21 @@ ARG REGISTRY=docker.io
|
|
|
FROM ${REGISTRY}/golang:1.22.1-alpine3.19 AS builder
|
|
|
RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /config/apk/repositories
|
|
|
|
|
|
-ARG APP_RELATIVE_PATH
|
|
|
-# ARG HTTP_PROT
|
|
|
-
|
|
|
WORKDIR /app
|
|
|
-COPY . /app
|
|
|
|
|
|
+ARG APP_ENV
|
|
|
+ARG APP_CONF
|
|
|
+
|
|
|
+ENV APP_ENV=${APP_ENV:?err}
|
|
|
+ENV APP_CONF=${APP_CONF:?err}
|
|
|
|
|
|
-# RUN rm -rf /app/bin/
|
|
|
-# RUN export GOPROXY=https://goproxy.cn,direct && go mod tidy
|
|
|
-# RUN go build -ldflags="-s -w" -o ./bin/server ${APP_RELATIVE_PATH}
|
|
|
+COPY . /app
|
|
|
+COPY ${APP_CONF} /app/websocket.yaml
|
|
|
|
|
|
RUN export GOPROXY=https://goproxy.cn,direct && \
|
|
|
go mod tidy && \
|
|
|
go build -ldflags="-s -w" -o /app
|
|
|
|
|
|
-# ENTRYPOINT ["top"]
|
|
|
-
|
|
|
FROM ${REGISTRY}/alpine:3.16
|
|
|
RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /config/apk/repositories
|
|
|
|
|
@@ -27,16 +25,11 @@ RUN apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /config/localtime \
|
|
|
&& apk del tzdata
|
|
|
|
|
|
|
|
|
-# ARG HTTP_PROT
|
|
|
-ARG APP_ENV
|
|
|
-ENV APP_ENV=${APP_ENV}
|
|
|
-# ENV HTTP_PROT=${HTTP_PROT}
|
|
|
-
|
|
|
WORKDIR /app
|
|
|
COPY --from=builder /app /app
|
|
|
|
|
|
# EXPOSE ${HTTP_PROT}
|
|
|
-ENTRYPOINT [ "./websocket" ]
|
|
|
+ENTRYPOINT [ "./websocket", "-f", "websocket.yaml" ]
|
|
|
# ENTRYPOINT [ "top" ]
|
|
|
|
|
|
|