From e7462ada12ec8edfd08d6c3b3a97a034211d51eb Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 8 Mar 2025 21:09:09 +0200 Subject: [PATCH] Reverted Docker changes of WeKan v7.68 to get WeKan Docker version working. Thanks to xet7 ! Fixes #5697 --- Dockerfile | 228 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 133 insertions(+), 95 deletions(-) diff --git a/Dockerfile b/Dockerfile index ff920af9d..64a4e921f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,76 +1,31 @@ -FROM scratch AS downloads - -# Download NodeJS bundle -ADD https://static.meteor.com/dev-bundle-node-os/v14.21.4/node-v14.21.4-linux-x64.tar.gz node.tar.gz - -# Download Meteor bundle -ADD https://static.meteor.com/packages-bootstrap/2.16/meteor-bootstrap-os.linux.x86_64.tar.gz meteor.tar.gz - -FROM ubuntu:24.04 AS build - -# Install node from official archive -RUN --mount=type=bind,from=downloads,source=node.tar.gz,target=node.tar.gz \ - tar xzf node.tar.gz --strip-components=1 --keep-old-files --no-same-owner - -# Install meteor from official archive -RUN --mount=type=bind,from=downloads,source=meteor.tar.gz,target=meteor.tar.gz \ - tar xzf meteor.tar.gz -C $HOME --no-same-owner - -# Update the npm version -RUN npm install -g npm@6.14.17 - -# Install several build dependencies -RUN apt update && \ - apt install --yes --no-install-suggests --no-install-recommends ssh git g++ curl ca-certificates && \ - rm -r /var/lib/apt/lists - -# Change to temporary working directory -WORKDIR /workdir - -# Copy package.json and package-lock.json to install application dependencies -COPY package.json . -COPY package-lock.json . - -# Install build dependencies -RUN $HOME/.meteor/meteor npm install --production - -# Copy meteor application configurations -COPY .meteor .meteor - -# Copy application sources -COPY packages packages -COPY imports imports -COPY config config -COPY models models -COPY public public -COPY server server -COPY client client - -# Build the application -RUN $HOME/.meteor/meteor build --directory /build --allow-superuser - -# Enter server bundle directory -WORKDIR /build/bundle/programs/server - -# Install server dependencies -RUN $HOME/.meteor/meteor npm install --production - -# Enter installation directory of fibers -WORKDIR /build/bundle/programs/server/node_modules/fibers - -# Build fibers integrations -RUN node build.js - -FROM ubuntu:24.04 AS wekan - -# Add metadata to image +FROM ubuntu:24.04 LABEL maintainer="wekan" LABEL org.opencontainers.image.ref.name="ubuntu" LABEL org.opencontainers.image.version="24.04" LABEL org.opencontainers.image.source="https://github.com/wekan/wekan" -# Set default environment variables -ENV WITH_API=true \ +# 2022-04-25: +# - gyp does not yet work with Ubuntu 22.04 ubuntu:rolling, +# so changing to 21.10. https://github.com/wekan/wekan/issues/4488 + +# 2021-09-18: +# - Above Ubuntu base image copied from Docker Hub ubuntu:hirsute-20210825 +# to Quay to avoid Docker Hub rate limits. +ARG DEBIAN_FRONTEND=noninteractive + +ENV BUILD_DEPS="apt-utils gnupg gosu wget bzip2 g++ curl libarchive-tools build-essential git ca-certificates python3" + +ENV \ + DEBUG=false \ + NODE_VERSION=v14.21.4 \ + METEOR_RELEASE=METEOR@2.14 \ + USE_EDGE=false \ + METEOR_EDGE=1.5-beta.17 \ + NPM_VERSION=6.14.17 \ + FIBERS_VERSION=4.0.1 \ + ARCHITECTURE=linux-x64 \ + SRC_PATH=./ \ + WITH_API=true \ RESULTS_PER_PAGE="" \ DEFAULT_BOARD_ID="" \ ACCOUNTS_LOCKOUT_KNOWN_USERS_FAILURES_BEFORE=3 \ @@ -203,36 +158,119 @@ ENV WITH_API=true \ WRITABLE_PATH=/data \ S3="" -# Install node and application sources from build stage -RUN --mount=type=bind,from=downloads,source=node.tar.gz,target=node.tar.gz \ - --mount=type=bind,from=build,source=/build,target=/build \ - # Install NodeJS - tar xzf node.tar.gz --strip-components=1 --keep-old-files --no-same-owner && \ - # Add the wekan user - useradd --uid 999 --user-group --system wekan && \ - # Copy wekan bundle - cp -r /build/bundle /wekan && \ - # Remove the web.browser.legacy platform - rm -r /wekan/programs/web.browser.legacy && \ - # Change ownership of wekan directory - chown wekan:wekan -R /wekan && \ - # Create the data directory - mkdir /data && \ - # Change ownership of data directory - chown wekan:root -R /data +# NODE_OPTIONS="--max_old_space_size=4096" + +#--------------------------------------------- +# == at docker-compose.yml: AUTOLOGIN WITH OIDC/OAUTH2 ==== +# https://github.com/wekan/wekan/wiki/autologin +#- OIDC_REDIRECTION_ENABLED=true +#--------------------------------------------------------------------- + +# Copy the app to the image +COPY ${SRC_PATH} /home/wekan/app + +# Install OS +RUN <