diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index c054a8c..0000000 --- a/.gitmodules +++ /dev/null @@ -1,12 +0,0 @@ -[submodule "playedu-api"] - path = playedu-api - url = https://github.com/PlayEdu/PlayEdu -[submodule "playedu-backend"] - path = playedu-backend - url = https://github.com/PlayEdu/backend -[submodule "playedu-h5"] - path = playedu-h5 - url = https://github.com/PlayEdu/h5 -[submodule "playedu-pc"] - path = playedu-pc - url = https://github.com/PlayEdu/frontend diff --git a/Dockerfile b/Dockerfile index 08881ef..886805d 100644 --- a/Dockerfile +++ b/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"] \ No newline at end of file diff --git a/docker/start.sh b/docker/start.sh new file mode 100644 index 0000000..64abd8e --- /dev/null +++ b/docker/start.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +nginx + +java -jar /app/api/app.jar \ No newline at end of file diff --git a/playedu-api b/playedu-api deleted file mode 160000 index 26074ef..0000000 --- a/playedu-api +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 26074efea4543ca138d7a70018210a42d676f070 diff --git a/playedu-backend b/playedu-backend deleted file mode 160000 index f897a02..0000000 --- a/playedu-backend +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f897a029f5e87b7a99648e8275fbad1eeca2a82b diff --git a/playedu-h5 b/playedu-h5 deleted file mode 160000 index e8e047d..0000000 --- a/playedu-h5 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e8e047da3718828fd292fac3a8ed7a1294fcbc57 diff --git a/playedu-pc b/playedu-pc deleted file mode 160000 index c00a723..0000000 --- a/playedu-pc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c00a7236a71f05aac1fafca2353c932f315465b9