md/docker/latest/Dockerfile.standalone
Libin YANG a9fa4c2824
Some checks failed
Build and Deploy / build-and-deploy (push) Has been skipped
Build and Push Docker Images / build (push) Failing after 1m0s
feat: build and deploy docker image (#495)
2024-12-23 19:59:59 +08:00

19 lines
485 B
Docker

ARG VER_GOLANG=1.17.6-alpine3.15
ARG VER_ALPINE=3.15
FROM "doocs/md:latest-assets" AS assets
FROM "golang:$VER_GOLANG" AS gobuilder
COPY --from=assets /app/* /app/assets/
COPY server/main.go /app
RUN apk add git bash gcc musl-dev upx
WORKDIR /app
RUN go build -ldflags "-w -s" -o md main.go && \
apk add upx && \
upx -9 -o md.minify md
FROM "alpine:$VER_ALPINE"
LABEL MAINTAINER="ylb<contact@yanglibin.info>"
COPY --from=gobuilder /app/md.minify /bin/md
EXPOSE 80
CMD ["md"]