From fa327868cb5561e2aa752a3b835080c1b16ef51b Mon Sep 17 00:00:00 2001 From: Benny Date: Sat, 7 Dec 2024 15:06:52 +0100 Subject: [PATCH] get rid of sub module --- .gitmodules | 3 --- Dockerfile | 23 +++++++---------------- YYeTsFE | 1 - scripts/dev_robots.sh | 4 ---- scripts/pre_build.sh | 8 -------- 5 files changed, 7 insertions(+), 32 deletions(-) delete mode 100644 .gitmodules delete mode 160000 YYeTsFE delete mode 100644 scripts/dev_robots.sh delete mode 100644 scripts/pre_build.sh diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e035f0fbe..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "YYeTsFE"] - path = YYeTsFE - url = https://github.com/tgbot-collection/YYeTsFE diff --git a/Dockerfile b/Dockerfile index 0c431bd91..b3f6c6d99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12-alpine as pybuilder +FROM python:3.12-alpine AS pybuilder RUN apk update && apk add --no-cache tzdata ca-certificates alpine-sdk libressl-dev libffi-dev cargo && \ apk add tiff-dev jpeg-dev openjpeg-dev zlib-dev freetype-dev lcms2-dev \ libwebp-dev tcl-dev tk-dev harfbuzz-dev fribidi-dev libimagequant-dev libxcb-dev libpng-dev @@ -7,23 +7,14 @@ COPY requirements.txt /requirements.txt RUN pip3 install --user -r /requirements.txt && rm /requirements.txt -FROM python:3.12-alpine as runner +FROM python:3.12-alpine AS runner RUN apk update && apk add --no-cache libressl jpeg-dev openjpeg-dev libimagequant-dev tiff-dev freetype-dev libxcb-dev -FROM node:20-alpine as nodebuilder -WORKDIR /YYeTsBot/YYeTsFE/ -ENV NODE_OPTIONS=--openssl-legacy-provider -ARG env -RUN apk add git -COPY YYeTsFE/package.json /YYeTsBot/YYeTsFE/ -COPY YYeTsFE/yarn.lock /YYeTsBot/YYeTsFE/ -COPY scripts/dev_robots.sh /tmp/ -RUN yarn --network-timeout 1000000 -COPY YYeTsFE /YYeTsBot/YYeTsFE/ -COPY .git /YYeTsBot/.git/ -RUN if [ "$env" = "dev" ]; then echo "dev build"; yarn build; sh /tmp/dev_robots.sh; else echo "prod build"; yarn run release; fi - +FROM alpine AS nodebuilder +RUN apk add curl jq +RUN wget $(curl -s https://api.github.com/repos/tgbot-collection/YYeTsFE/releases/latest | jq -r '.assets[] | select(.name == "build.zip") | .browser_download_url') +RUN unzip build.zip && rm build.zip FROM runner RUN apk add mongodb-tools mysql-client @@ -32,7 +23,7 @@ COPY . /YYeTsBot COPY --from=pybuilder /root/.local /usr/local COPY --from=pybuilder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=pybuilder /usr/share/zoneinfo /usr/share/zoneinfo -COPY --from=nodebuilder /YYeTsBot/YYeTsFE/build /YYeTsBot/yyetsweb/templates/ +COPY --from=nodebuilder /build /YYeTsBot/yyetsweb/templates/ ENV TZ=Asia/Shanghai WORKDIR /YYeTsBot/yyetsbot diff --git a/YYeTsFE b/YYeTsFE deleted file mode 160000 index 5807eba2b..000000000 --- a/YYeTsFE +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5807eba2b857f2b9ae87299b4578da34824fca01 diff --git a/scripts/dev_robots.sh b/scripts/dev_robots.sh deleted file mode 100644 index c4a40f7dc..000000000 --- a/scripts/dev_robots.sh +++ /dev/null @@ -1,4 +0,0 @@ -cat << EOF > /YYeTsBot/YYeTsFE/build/robots.txt -User-agent: * -Disallow: / -EOF diff --git a/scripts/pre_build.sh b/scripts/pre_build.sh deleted file mode 100644 index dc4e2cb83..000000000 --- a/scripts/pre_build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -cat << EOF >> YYeTsFE/.env -REACT_APP_DOMAIN=$REACT_APP_DOMAIN -REACT_APP_GA=$REACT_APP_GA -# sourcemap -GENERATE_SOURCEMAP=$GENERATE_SOURCEMAP -REACT_APP_ADSENSE=$REACT_APP_ADSENSE -EOF