mirror of
https://github.com/PlayEdu/docker-playedu-light
synced 2025-06-09 03:54:12 +08:00
直接编译
This commit is contained in:
parent
cdecc60ac4
commit
f29d8307d5
35
.github/workflows/build.yml
vendored
Normal file
35
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
name: EstablishDockerImage
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- dev
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE_FQDN: registry.cn-hangzhou.aliyuncs.com/playedu/light
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
- name: Login to GHCR
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: registry.cn-hangzhou.aliyuncs.com
|
||||||
|
username: ${{ secrets.ALI_REGISTRY_EMAIL }}
|
||||||
|
password: ${{ secrets.ALI_REGISTRY_PASS }}
|
||||||
|
- name: Build
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ env.IMAGE_FQDN }}:1.3
|
12
.gitmodules
vendored
Normal file
12
.gitmodules
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[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
|
41
Dockerfile
41
Dockerfile
@ -1,3 +1,30 @@
|
|||||||
|
FROM eclipse-temurin:17 as ApiBuilder
|
||||||
|
|
||||||
|
COPY playedu-api /app
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# 编译jar包
|
||||||
|
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
|
||||||
|
|
||||||
|
# 编译后端
|
||||||
|
WORKDIR /app/backend
|
||||||
|
RUN npm i && VITE_APP_URL=/api/ npm run build
|
||||||
|
|
||||||
|
# 编译PC
|
||||||
|
WORKDIR /app/pc
|
||||||
|
RUN npm i && VITE_APP_URL=/api/ npm run build
|
||||||
|
|
||||||
|
# 编译H5
|
||||||
|
WORKDIR /app/h5
|
||||||
|
RUN npm i && VITE_APP_URL=/api/ npm run build
|
||||||
|
|
||||||
FROM eclipse-temurin:17
|
FROM eclipse-temurin:17
|
||||||
|
|
||||||
LABEL maintainer="0xtyz <tengyongzhi@meedu.vip>"
|
LABEL maintainer="0xtyz <tengyongzhi@meedu.vip>"
|
||||||
@ -10,12 +37,14 @@ RUN apt update && apt install -y nginx
|
|||||||
|
|
||||||
RUN mkdir /app
|
RUN mkdir /app
|
||||||
|
|
||||||
#Copy代码
|
COPY --from=ApiBuilder /app/playedu-api/target/playedu-api.jar /app/app.jar
|
||||||
COPY frontend /app/frontend
|
|
||||||
COPY backend /app/backend
|
COPY --from=NodeBuilder /app/backend/dist /app/backend
|
||||||
COPY h5 /app/h5
|
COPY --from=NodeBuilder /app/pc/dist /app/frontend
|
||||||
COPY api /app/api
|
COPY --from=NodeBuilder /app/h5/dist /app/h5
|
||||||
COPY conf/nginx.conf /etc/nginx/sites-enabled/default
|
|
||||||
|
# 复制nginx配置文件
|
||||||
|
COPY docker/nginx/conf/nginx.conf /etc/nginx/sites-enabled/default
|
||||||
|
|
||||||
RUN chmod +x /app/api/start.sh
|
RUN chmod +x /app/api/start.sh
|
||||||
|
|
||||||
|
3
api/.gitignore
vendored
3
api/.gitignore
vendored
@ -1,3 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
||||||
!start.sh
|
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
nginx
|
|
||||||
|
|
||||||
java -jar /app/api/app.jar --spring.profiles.active=prod --spring.datasource.url="jdbc:mysql://${DB_HOST}:${DB_PORT:-3306}/${DB_NAME}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false" --spring.datasource.username=${DB_USER} --spring.datasource.password=${DB_PASS} --spring.data.redis.host=${REDIS_HOST} --spring.data.redis.port=${REDIS_PORT} --spring.data.redis.password=${REDIS_PASS} --spring.data.redis.database=${REDIS_DB:-0} --sa-token.is-concurrent=${SA_TOKEN_IS_CONCURRENT:-false} --sa-token.jwt-secret-key=${SA_TOKEN_JWT_SECRET_KEY:-playeduxyz}
|
|
1
playedu-api
Submodule
1
playedu-api
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 26074efea4543ca138d7a70018210a42d676f070
|
1
playedu-backend
Submodule
1
playedu-backend
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit f897a029f5e87b7a99648e8275fbad1eeca2a82b
|
1
playedu-h5
Submodule
1
playedu-h5
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit e8e047da3718828fd292fac3a8ed7a1294fcbc57
|
1
playedu-pc
Submodule
1
playedu-pc
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit c00a7236a71f05aac1fafca2353c932f315465b9
|
Loading…
x
Reference in New Issue
Block a user