A local-first personal finance app
build: bump docker image base, set node_env=prod (#479)
Nunob98ff3f50dfc
diff --git a/Dockerfile b/Dockerfileindex ad5aa098ed..028f514f9b 100644--- a/Dockerfile+++ b/Dockerfile@@ -1,11 +1,11 @@-FROM node:18-bullseye as base+FROM node:18-bookworm as baseRUN apt-get update && apt-get install -y opensslWORKDIR /app-ADD .yarn ./.yarn-ADD yarn.lock package.json .yarnrc.yml ./+COPY .yarn ./.yarn+COPY yarn.lock package.json .yarnrc.yml ./RUN yarn workspaces focus --all --production-FROM node:18-bullseye-slim as prod+FROM node:18-bookworm-slim as prodRUN apt-get update && apt-get install tini && apt-get clean -y && rm -rf /var/lib/apt/lists/*ARG USERNAME=actual@@ -16,10 +16,11 @@ RUN groupadd --gid $USER_GID $USERNAME \RUN mkdir /data && chown -R ${USERNAME}:${USERNAME} /dataWORKDIR /app+ENV NODE_ENV productionCOPY --from=base /app/node_modules /app/node_modules-ADD package.json app.js ./-ADD src ./src-ADD migrations ./migrations+COPY package.json app.js ./+COPY src ./src+COPY migrations ./migrationsENTRYPOINT ["/usr/bin/tini","-g", "--"]EXPOSE 5006CMD ["node", "app.js"]diff --git a/docker/edge-alpine.Dockerfile b/docker/edge-alpine.Dockerfileindex 7c3f57ec03..eece22ebcb 100644--- a/docker/edge-alpine.Dockerfile+++ b/docker/edge-alpine.Dockerfile@@ -1,21 +1,21 @@-FROM alpine:3.17 as base+FROM alpine:3.18 as baseRUN apk add --no-cache nodejs yarn npm python3 openssl build-base jq curlWORKDIR /app-ADD .yarn ./.yarn-ADD yarn.lock package.json .yarnrc.yml ./+COPY .yarn ./.yarn+COPY yarn.lock package.json .yarnrc.yml ./RUN if [ "$(uname -m)" = "armv7l" ]; then yarn config set taskPoolConcurrency 2; yarn config set networkConcurrency 5; fiRUN yarn workspaces focus --all --productionRUN if [ "$(uname -m)" = "armv7l" ]; then npm install bcrypt better-sqlite3 --build-from-source; fiRUN mkdir /public-ADD artifacts.json /tmp/artifacts.json+COPY artifacts.json /tmp/artifacts.jsonRUN jq -r '[.artifacts[] | select(.workflow_run.head_branch == "master" and .workflow_run.head_repository_id == .workflow_run.repository_id)][0]' /tmp/artifacts.json > /tmp/latest-build.jsonARG GITHUB_TOKENRUN curl -L -o /tmp/desktop-client.zip --header "Authorization: Bearer ${GITHUB_TOKEN}" $(jq -r '.archive_download_url' /tmp/latest-build.json)RUN unzip /tmp/desktop-client.zip -d /public-FROM alpine:3.17 as prod+FROM alpine:3.18 as prodRUN apk add --no-cache nodejs tiniARG USERNAME=actual@@ -25,11 +25,12 @@ RUN addgroup -S ${USERNAME} -g ${USER_GID} && adduser -S ${USERNAME} -G ${USERNARUN mkdir /data && chown -R ${USERNAME}:${USERNAME} /dataWORKDIR /app+ENV NODE_ENV productionCOPY --from=base /app/node_modules /app/node_modulesCOPY --from=base /public /public-ADD package.json app.js ./-ADD src ./src-ADD migrations ./migrations+COPY package.json app.js ./+COPY src ./src+COPY migrations ./migrationsENTRYPOINT ["/sbin/tini","-g", "--"]ENV ACTUAL_WEB_ROOT=/publicEXPOSE 5006diff --git a/docker/edge-ubuntu.Dockerfile b/docker/edge-ubuntu.Dockerfileindex 99e4e757ef..500b226541 100644--- a/docker/edge-ubuntu.Dockerfile+++ b/docker/edge-ubuntu.Dockerfile@@ -1,20 +1,20 @@-FROM node:18-bullseye as base+FROM node:18-bookworm as baseRUN apt-get update && apt-get install -y openssl jqWORKDIR /app-ADD .yarn ./.yarn-ADD yarn.lock package.json .yarnrc.yml ./+COPY .yarn ./.yarn+COPY yarn.lock package.json .yarnrc.yml ./RUN if [ "$(uname -m)" = "armv7l" ]; then yarn config set taskPoolConcurrency 2; yarn config set networkConcurrency 5; fiRUN yarn workspaces focus --all --productionRUN mkdir /public-ADD artifacts.json /tmp/artifacts.json+COPY artifacts.json /tmp/artifacts.jsonRUN jq -r '[.artifacts[] | select(.workflow_run.head_branch == "master" and .workflow_run.head_repository_id == .workflow_run.repository_id)][0]' /tmp/artifacts.json > /tmp/latest-build.jsonARG GITHUB_TOKENRUN curl -L -o /tmp/desktop-client.zip --header "Authorization: Bearer ${GITHUB_TOKEN}" $(jq -r '.archive_download_url' /tmp/latest-build.json)RUN unzip /tmp/desktop-client.zip -d /public-FROM node:18-bullseye-slim as prod+FROM node:18-bookworm-slim as prodRUN apt-get update && apt-get install tini && apt-get clean -y && rm -rf /var/lib/apt/lists/*ARG USERNAME=actual@@ -25,11 +25,12 @@ RUN groupadd --gid $USER_GID $USERNAME \RUN mkdir /data && chown -R ${USERNAME}:${USERNAME} /dataWORKDIR /app+ENV NODE_ENV productionCOPY --from=base /app/node_modules /app/node_modulesCOPY --from=base /public /public-ADD package.json app.js ./-ADD src ./src-ADD migrations ./migrations+COPY package.json app.js ./+COPY src ./src+COPY migrations ./migrationsENTRYPOINT ["/usr/bin/tini","-g", "--"]ENV ACTUAL_WEB_ROOT=/publicEXPOSE 5006diff --git a/docker/stable-alpine.Dockerfile b/docker/stable-alpine.Dockerfileindex e6b2165204..cc00678561 100644--- a/docker/stable-alpine.Dockerfile+++ b/docker/stable-alpine.Dockerfile@@ -1,13 +1,13 @@-FROM alpine:3.17 as base+FROM alpine:3.18 as baseRUN apk add --no-cache nodejs yarn npm python3 openssl build-baseWORKDIR /app-ADD .yarn ./.yarn-ADD yarn.lock package.json .yarnrc.yml ./+COPY .yarn ./.yarn+COPY yarn.lock package.json .yarnrc.yml ./RUN if [ "$(uname -m)" = "armv7l" ]; then yarn config set taskPoolConcurrency 2; yarn config set networkConcurrency 5; fiRUN yarn workspaces focus --all --productionRUN if [ "$(uname -m)" = "armv7l" ]; then npm install bcrypt better-sqlite3 --build-from-source; fi-FROM alpine:3.17 as prod+FROM alpine:3.18 as prodRUN apk add --no-cache nodejs tiniARG USERNAME=actual@@ -17,10 +17,11 @@ RUN addgroup -S ${USERNAME} -g ${USER_GID} && adduser -S ${USERNAME} -G ${USERNARUN mkdir /data && chown -R ${USERNAME}:${USERNAME} /dataWORKDIR /app+ENV NODE_ENV productionCOPY --from=base /app/node_modules /app/node_modules-ADD package.json app.js ./-ADD src ./src-ADD migrations ./migrations+COPY package.json app.js ./+COPY src ./src+COPY migrations ./migrationsENTRYPOINT ["/sbin/tini","-g", "--"]EXPOSE 5006CMD ["node", "app.js"]diff --git a/docker/stable-ubuntu.Dockerfile b/docker/stable-ubuntu.Dockerfileindex eb02aad66f..0f20d19258 100644--- a/docker/stable-ubuntu.Dockerfile+++ b/docker/stable-ubuntu.Dockerfile@@ -1,12 +1,12 @@-FROM node:18-bullseye as base+FROM node:18-bookworm as baseRUN apt-get update && apt-get install -y opensslWORKDIR /app-ADD .yarn ./.yarn-ADD yarn.lock package.json .yarnrc.yml ./+COPY .yarn ./.yarn+COPY yarn.lock package.json .yarnrc.yml ./RUN if [ "$(uname -m)" = "armv7l" ]; then yarn config set taskPoolConcurrency 2; yarn config set networkConcurrency 5; fiRUN yarn workspaces focus --all --production-FROM node:18-bullseye-slim as prod+FROM node:18-bookworm-slim as prodRUN apt-get update && apt-get install tini && apt-get clean -y && rm -rf /var/lib/apt/lists/*ARG USERNAME=actual@@ -17,10 +17,11 @@ RUN groupadd --gid $USER_GID $USERNAME \RUN mkdir /data && chown -R ${USERNAME}:${USERNAME} /dataWORKDIR /app+ENV NODE_ENV productionCOPY --from=base /app/node_modules /app/node_modules-ADD package.json app.js ./-ADD src ./src-ADD migrations ./migrations+COPY package.json app.js ./+COPY src ./src+COPY migrations ./migrationsENTRYPOINT ["/usr/bin/tini","-g", "--"]EXPOSE 5006CMD ["node", "app.js"]diff --git a/upcoming-release-notes/479.md b/upcoming-release-notes/479.mdnew file mode 100644index 0000000000..17fd70b70e--- /dev/null+++ b/upcoming-release-notes/479.md@@ -0,0 +1,6 @@+---+category: Maintenance+authors: [rare-magma]+---++Updates the docker images base version and set node_env env variable to production