This commit is contained in:
xxx 2023-09-05 11:09:32 +08:00
parent f5793200f7
commit 3c03e140af
7 changed files with 28 additions and 21 deletions

12
.gitmodules vendored
View File

@ -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

View File

@ -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"]

5
docker/start.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
nginx
java -jar /app/api/app.jar

@ -1 +0,0 @@
Subproject commit 26074efea4543ca138d7a70018210a42d676f070

@ -1 +0,0 @@
Subproject commit f897a029f5e87b7a99648e8275fbad1eeca2a82b

@ -1 +0,0 @@
Subproject commit e8e047da3718828fd292fac3a8ed7a1294fcbc57

@ -1 +0,0 @@
Subproject commit c00a7236a71f05aac1fafca2353c932f315465b9