mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-22 18:25:47 +08:00
19 lines
602 B
Docker
19 lines
602 B
Docker
FROM golang:1.16 AS BACK
|
|
WORKDIR /go/src/casdoor
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o server . \
|
|
&& apt update && apt install wait-for-it && chmod +x /usr/bin/wait-for-it
|
|
|
|
FROM node:14.17.4 AS FRONT
|
|
WORKDIR /web
|
|
COPY ./web .
|
|
RUN npm install && npm run build
|
|
|
|
FROM alpine:latest
|
|
LABEL MAINTAINER="https://casdoor.org/"
|
|
|
|
COPY --from=BACK /go/src/casdoor/ ./
|
|
COPY --from=BACK /usr/bin/wait-for-it ./
|
|
RUN mkdir -p web/build && apk add --no-cache bash coreutils
|
|
COPY --from=FRONT /web/build /web/build
|
|
ENTRYPOINT ["./wait-for-it", "db:3306 ", "--", "./server"] |