2021-12-12 22:28:14 +08:00
|
|
|
FROM golang:1.17.5 AS BACK
|
2021-08-11 21:39:34 +08:00
|
|
|
WORKDIR /go/src/casdoor
|
|
|
|
COPY . .
|
2022-04-13 14:04:40 +08:00
|
|
|
RUN ./build.sh && apt update && apt install wait-for-it && chmod +x /usr/bin/wait-for-it
|
2021-08-11 21:39:34 +08:00
|
|
|
|
2021-12-12 22:28:14 +08:00
|
|
|
FROM node:16.13.0 AS FRONT
|
2021-08-11 21:39:34 +08:00
|
|
|
WORKDIR /web
|
|
|
|
COPY ./web .
|
2022-02-11 22:54:15 +08:00
|
|
|
RUN yarn config set registry https://registry.npmmirror.com
|
2021-09-21 00:00:33 +08:00
|
|
|
RUN yarn install && yarn run build
|
2021-08-11 21:39:34 +08:00
|
|
|
|
2021-12-22 21:58:25 +08:00
|
|
|
|
|
|
|
FROM debian:latest AS ALLINONE
|
2022-02-14 00:18:26 +08:00
|
|
|
RUN apt update
|
|
|
|
RUN apt install -y ca-certificates && update-ca-certificates
|
|
|
|
RUN apt install -y mariadb-server mariadb-client && mkdir -p web/build && chmod 777 /tmp
|
2021-12-22 21:58:25 +08:00
|
|
|
LABEL MAINTAINER="https://casdoor.org/"
|
|
|
|
COPY --from=BACK /go/src/casdoor/ ./
|
|
|
|
COPY --from=BACK /usr/bin/wait-for-it ./
|
|
|
|
COPY --from=FRONT /web/build /web/build
|
2021-12-23 12:43:04 +08:00
|
|
|
CMD chmod 777 /tmp && service mariadb start&&\
|
|
|
|
if [ "${MYSQL_ROOT_PASSWORD}" = "" ] ;then MYSQL_ROOT_PASSWORD=123456 ; fi&&\
|
|
|
|
mysqladmin -u root password ${MYSQL_ROOT_PASSWORD} &&\
|
2022-01-13 11:35:13 +08:00
|
|
|
./wait-for-it localhost:3306 -- ./server --createDatabase=true
|
2021-12-22 21:58:25 +08:00
|
|
|
|
|
|
|
|
2021-08-11 21:39:34 +08:00
|
|
|
FROM alpine:latest
|
2021-09-21 01:06:57 +08:00
|
|
|
RUN sed -i 's/https/http/' /etc/apk/repositories
|
|
|
|
RUN apk add curl
|
2022-02-14 00:18:26 +08:00
|
|
|
RUN apk add ca-certificates && update-ca-certificates
|
2021-08-11 21:39:34 +08:00
|
|
|
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
|
2022-01-22 15:50:48 +08:00
|
|
|
CMD ./server
|