sub2sing-box/Dockerfile

27 lines
560 B
Docker
Raw Normal View History

2024-03-13 00:11:34 +08:00
FROM golang:1.21 as builder
LABEL authors="nite07"
WORKDIR /app
COPY . .
RUN go mod download
ARG version
2024-03-19 23:35:13 +08:00
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X sub2sing-box/constant.Version=${version}" -o sub2sing-box main.go
2024-03-13 00:11:34 +08:00
2024-03-18 22:32:33 +08:00
WORKDIR /app
2024-03-13 00:11:34 +08:00
FROM alpine:latest
COPY --from=builder /app/sub2sing-box /app/sub2sing-box
2024-03-18 22:32:33 +08:00
COPY --from=builder /app/templates /app/templates-origin
COPY --from=builder /app/entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
VOLUME [ "/app/templates" ]
EXPOSE 8080
2024-03-13 00:11:34 +08:00
2024-03-18 22:32:33 +08:00
ENTRYPOINT ["/app/entrypoint.sh"]