From fb9ce80e538df8f7e38714be2c44b1dcbe27bea5 Mon Sep 17 00:00:00 2001 From: Marc Sune Date: Mon, 29 Apr 2024 15:06:47 +0200 Subject: [PATCH] Tc --- .github/workflows/publish_docker.yaml | 1 + Dockerfile.bookworm | 53 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 Dockerfile.bookworm diff --git a/.github/workflows/publish_docker.yaml b/.github/workflows/publish_docker.yaml index bcfa757e5..282c6b56a 100644 --- a/.github/workflows/publish_docker.yaml +++ b/.github/workflows/publish_docker.yaml @@ -43,3 +43,4 @@ jobs: cd turnilo export TAG=$(git describe HEAD | sed 's/-.*$//g') docker buildx build --platform ${PLATFORMS} --push -f Dockerfile . --tag ghcr.io/${GITHUB_REPOSITORY}:${TAG} + docker buildx build --platform ${PLATFORMS} --push -f Dockerfile.bookworm . --tag ghcr.io/${GITHUB_REPOSITORY}:${TAG}-bookworm diff --git a/Dockerfile.bookworm b/Dockerfile.bookworm new file mode 100644 index 000000000..c3f53927b --- /dev/null +++ b/Dockerfile.bookworm @@ -0,0 +1,53 @@ +# +# BUILD stage +# +FROM node:16 AS build + +WORKDIR /usr/src/app + +# Install and cache dependencies +COPY package.json package-lock.json ./ +RUN npm ci + +# Copy sources (see .dockerignore) +COPY . ./ + +# Build and test +RUN npm run build + +# Prune dev dependencies from node_modules +RUN npm prune --production + +# +# RUNTIME stage +# We pick last node 16.x to get recommended security updates. Any 16.x node should work as runtime. +# +FROM node:16 as runtime + +WORKDIR /app + +# Example configuration and packages.json +COPY --from=build /usr/src/app/config-examples.yaml /usr/src/app/package.json /usr/src/app/package-lock.json ./ + +# Wikiticker dataset +COPY --from=build /usr/src/app/assets ./assets + +# Main JS +COPY --from=build /usr/src/app/bin ./bin + +# Build results +COPY --from=build /usr/src/app/build ./build + +# Dependencies +COPY --from=build /usr/src/app/node_modules ./node_modules + +# Install python3 stuff to configure turnilo +RUN apt-get update && \ + apt-get install -y python3-jinja2 python3-yaml python3-requests && \ + apt-get -y clean && \ + rm -rf /var/lib/apt/lists/* + +# Expose default port +EXPOSE 9090 + +ENTRYPOINT [ "/nodejs/bin/node", "bin/turnilo" ]