diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 964cb56f..3bf88a27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -133,6 +133,10 @@ jobs: name: dist path: backend/dist.zip + - name: Unzip webui + run: | + unzip backend/dist.zip -d backend/src/ + - name: Build and push uses: docker/build-push-action@v4 with: diff --git a/Dockerfile b/Dockerfile index 58a287a0..f69e046b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,8 +17,8 @@ ENV S6_SERVICES_GRACETIME=30000 \ WORKDIR /app COPY backend/requirements.txt . -COPY backend/dist.zip . -RUN apk add --no-cache \ +RUN set -ex && \ + apk add --no-cache \ bash \ ca-certificates \ coreutils \ @@ -32,22 +32,18 @@ RUN apk add --no-cache \ s6-overlay \ shadow \ tzdata && \ - python3 -m pip install --upgrade pip && \ + python3 -m pip install --no-cache-dir --upgrade pip && \ sed -i '/bcrypt/d' requirements.txt && \ pip install --no-cache-dir -r requirements.txt && \ - # Unzip WebUI \ - unzip dist.zip && \ # Add user addgroup -S ab -g 911 && \ adduser -S ab -G ab -h /ab -s /bin/bash -u 911 && \ # Clear rm -rf \ - /root/.cache \ - /tmp/* \ - /app/dist.zip + /tmp/* COPY --chmod=755 backend/src/. . -COPY --chmod=755 backend/src/docker / +COPY --chmod=755 docker/ / ENTRYPOINT [ "/init" ] diff --git a/backend/src/docker/etc/cont-init.d/010-old-compatible b/docker/etc/cont-init.d/010-old-compatible similarity index 100% rename from backend/src/docker/etc/cont-init.d/010-old-compatible rename to docker/etc/cont-init.d/010-old-compatible diff --git a/backend/src/docker/etc/cont-init.d/020-fixuser b/docker/etc/cont-init.d/020-fixuser similarity index 100% rename from backend/src/docker/etc/cont-init.d/020-fixuser rename to docker/etc/cont-init.d/020-fixuser diff --git a/backend/src/docker/etc/services.d/auto_bangumi/finish b/docker/etc/services.d/auto_bangumi/finish similarity index 100% rename from backend/src/docker/etc/services.d/auto_bangumi/finish rename to docker/etc/services.d/auto_bangumi/finish diff --git a/backend/src/docker/etc/services.d/auto_bangumi/notification-fd b/docker/etc/services.d/auto_bangumi/notification-fd similarity index 100% rename from backend/src/docker/etc/services.d/auto_bangumi/notification-fd rename to docker/etc/services.d/auto_bangumi/notification-fd diff --git a/backend/src/docker/etc/services.d/auto_bangumi/run b/docker/etc/services.d/auto_bangumi/run similarity index 100% rename from backend/src/docker/etc/services.d/auto_bangumi/run rename to docker/etc/services.d/auto_bangumi/run