From 8c44b277d6c6f85dc36855e7dd5f9819e45e5429 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Sat, 20 Jul 2024 08:18:17 +0800 Subject: [PATCH] fix --- .github/workflows/docker.yml | 6 +++++- distribution/containers/tyr.Dockerfile | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 distribution/containers/tyr.Dockerfile diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 796f6c0af..51a77b450 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -17,6 +17,10 @@ jobs: node-version: 'lts/*' cache: npm + - run: npm ci + - run: npm run build + - run: cp -r dist/ build/ + - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -48,7 +52,7 @@ jobs: context: . push: true provenance: false - file: Dockerfile + file: distribution/containers/tyr.Dockerfile platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/distribution/containers/tyr.Dockerfile b/distribution/containers/tyr.Dockerfile new file mode 100644 index 000000000..01bbecc57 --- /dev/null +++ b/distribution/containers/tyr.Dockerfile @@ -0,0 +1,24 @@ +# Use node alpine docker image +FROM docker.io/node:lts-alpine + +# Install runtime dependencies +RUN apk --no-cache add \ + mediainfo \ + tini \ + coreutils + +COPY package.json package-lock.json build /app/ + +WORKDIR /app/ + +RUN mv build dist &&\ + npm install --ignore-scripts --omit=dev &&\ + npm cache clean --force + + +# Expose port 3000 +EXPOSE 3000 + +# Flood +ENV FLOOD_OPTION_HOST="0.0.0.0" +ENTRYPOINT ["/sbin/tini", "--", "node", "--enable-source-maps", "--use_strict", "dist/index.js"]