11 Commits
dev ... 1.6

Author SHA1 Message Date
xxx
026d993b01 1.6 2024-02-20 15:48:25 +08:00
xxx
a8525a0634 fixed: build 2023-11-20 10:57:09 +08:00
xxx
3eb3273f09 优化builder 2023-11-20 10:48:33 +08:00
xxx
adbf75bcd4 1.5.1 2023-11-17 11:57:12 +08:00
xxx
5f7410ec33 update ver 2023-11-15 15:49:17 +08:00
xxx
a5272cd8cd github 打tag才执行 2023-11-15 15:47:42 +08:00
xxx
ac9a9c6935 v1.5 2023-11-15 15:11:57 +08:00
xxx
6a6a0095c2 update ver 2023-09-27 09:16:53 +08:00
xxx
4737baff59 v1.4 2023-09-26 21:24:04 +08:00
xxx
371e60ef21 nginx的最大请求尺寸 2023-09-06 21:31:48 +08:00
xxx
3ed1549c4d v1.3 2023-09-06 17:20:44 +08:00
5 changed files with 24 additions and 33 deletions

View File

@@ -2,9 +2,8 @@ name: EstablishDockerImage
on:
push:
branches:
- main
- dev
tags:
- "*"
env:
IMAGE_FQDN: registry.cn-hangzhou.aliyuncs.com/playedu/light
@@ -34,4 +33,4 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.IMAGE_FQDN }}:1.3
${{ env.IMAGE_FQDN }}:${{ github.ref_name }}

View File

@@ -1,19 +1,3 @@
FROM eclipse-temurin:17 as ApiBuilder
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/playedu/mvnw -Dmaven.test.skip=true clean package
FROM node:20-alpine as NodeBuilder
# install git - apt-get replace with apk
@@ -23,9 +7,9 @@ RUN apk update && \
# 编译后端
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
RUN git clone -b 1.6 https://github.com/PlayEdu/backend.git backend
RUN git clone -b 1.6 https://github.com/PlayEdu/frontend.git pc
RUN git clone -b 1.6 https://github.com/PlayEdu/h5.git h5
# 编译后台
WORKDIR /app/backend
@@ -39,21 +23,19 @@ RUN npm i && VITE_APP_URL=/api/ npm run build
WORKDIR /app/h5
RUN npm i && VITE_APP_URL=/api/ npm run build
FROM eclipse-temurin:17
FROM registry.cn-hangzhou.aliyuncs.com/playedu/api:1.6
LABEL maintainer="0xtyz <tengyongzhi@meedu.vip>"
LABEL maintainer="滕勇志 <tengyongzhi@meedu.vip>"
#使用东八区时间环境
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# 使用东八区时间环境
RUN echo "Asia/Shanghai" > /etc/timezone
#安装基本组件
RUN apt update && apt install -y nginx
RUN mkdir /app
COPY docker/start.sh /app/api/start.sh
COPY --from=ApiBuilder /app/playedu/playedu-api/target/playedu-api.jar /app/api/app.jar
RUN mv /app/app.jar /app/api/app.jar
COPY --from=NodeBuilder /app/backend/dist /app/backend
COPY --from=NodeBuilder /app/pc/dist /app/frontend

View File

@@ -7,7 +7,12 @@
在命令行中执行:
```
docker run -d -p 9700:80 -p 9800:9800 -p 9801:9801 -p 9900:9900 --name playedu-light \
docker run -d --restart=always \
--name playedu-light \
-p 9700:80 \
-p 9800:9800 \
-p 9801:9801 \
-p 9900:9900 \
-e DB_HOST=数据库host \
-e DB_PORT=数据库端口 \
-e DB_NAME=数据库名 \
@@ -16,7 +21,10 @@ docker run -d -p 9700:80 -p 9800:9800 -p 9801:9801 -p 9900:9900 --name playedu-l
-e REDIS_HOST=Redis的host \
-e REDIS_PORT=Redis的端口 \
-e REDIS_PASS=redis的密码 \
registry.cn-hangzhou.aliyuncs.com/playedu/light:1.3
-e REDIS_DB=2 \
-e SA_TOKEN_IS_CONCURRENT=false \
-e SA_TOKEN_JWT_SECRET_KEY=playeduxyz \
registry.cn-hangzhou.aliyuncs.com/playedu/light:1.6
```
跑起来之后,可以通过下面的链接访问前后台:

View File

@@ -1,3 +1,5 @@
client_max_body_size 50m;
server {
# 监听端口号9800
listen 9800 default_server;

View File

@@ -2,4 +2,4 @@
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}
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&allowPublicKeyRetrieval=true" --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}