pms/cicd/Dockerfile

13 lines
439 B
Docker
Raw Normal View History

2024-08-17 16:52:03 +08:00
ARG registry=registry.cn-hangzhou.aliyuncs.com/syschan
FROM ${registry}/golang:alpine as builder
WORKDIR /app
2024-08-17 17:19:25 +08:00
COPY . .
2024-08-17 17:29:01 +08:00
RUN cd server && go generate
RUN go build -o ./cicd/bin/pms-server -v .
2024-08-17 16:52:03 +08:00
FROM ${registry}/alpine:latest
WORKDIR /app
2024-08-17 17:19:25 +08:00
COPY --from=builder /app/cicd/bin/ .
2024-08-17 16:52:03 +08:00
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk add bash && chmod +x ./start/script.sh
CMD ["bash","-c","./start/script.sh"]