mirror of
https://github.com/PlayEdu/docker-playedu-light
synced 2025-12-22 21:09:55 +08:00
rebuild
This commit is contained in:
28
Dockerfile
28
Dockerfile
@@ -1,19 +1,33 @@
|
||||
FROM eclipse-temurin:17 as ApiBuilder
|
||||
|
||||
COPY playedu-api /app
|
||||
RUN apt-get update && \
|
||||
apt-get upgrade -y && \
|
||||
apt-get install -y git
|
||||
|
||||
RUN mkdir /app
|
||||
|
||||
WORKDIR /app
|
||||
RUN git clone -b dev https://github.com/PlayEdu/PlayEdu.git playedu
|
||||
|
||||
# 编译jar包
|
||||
WORKDIR /app/playedu
|
||||
|
||||
RUN /app/mvnw -Dmaven.test.skip=true clean package
|
||||
|
||||
FROM node:20-alpine as NodeBuilder
|
||||
|
||||
COPY playedu-backend /app/backend
|
||||
COPY playedu-pc /app/pc
|
||||
COPY playedu-h5 /app/h5
|
||||
# install git - apt-get replace with apk
|
||||
RUN apk update && \
|
||||
apk upgrade && \
|
||||
apk add --no-cache bash git openssh
|
||||
|
||||
# 编译后端
|
||||
WORKDIR /app
|
||||
RUN git clone -b dev https://github.com/PlayEdu/backend.git backend
|
||||
RUN git clone -b dev https://github.com/PlayEdu/frontend.git pc
|
||||
RUN git clone -b dev https://github.com/PlayEdu/h5.git h5
|
||||
|
||||
# 编译后台
|
||||
WORKDIR /app/backend
|
||||
RUN npm i && VITE_APP_URL=/api/ npm run build
|
||||
|
||||
@@ -37,7 +51,9 @@ RUN apt update && apt install -y nginx
|
||||
|
||||
RUN mkdir /app
|
||||
|
||||
COPY --from=ApiBuilder /app/playedu-api/target/playedu-api.jar /app/app.jar
|
||||
COPY docker/start.sh /app/api/start.sh
|
||||
|
||||
COPY --from=ApiBuilder /app/playedu/playedu-api/target/playedu-api.jar /app/api/app.jar
|
||||
|
||||
COPY --from=NodeBuilder /app/backend/dist /app/backend
|
||||
COPY --from=NodeBuilder /app/pc/dist /app/frontend
|
||||
@@ -48,4 +64,6 @@ COPY docker/nginx/conf/nginx.conf /etc/nginx/sites-enabled/default
|
||||
|
||||
RUN chmod +x /app/api/start.sh
|
||||
|
||||
WORKDIR /app/api
|
||||
|
||||
ENTRYPOINT ["/app/api/start.sh"]
|
||||
Reference in New Issue
Block a user