diff --git a/Dockerfile b/Dockerfile index 1fadc367b..bc34ba7af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,76 @@ -FROM ubuntu:24.10 +FROM scratch AS downloads + +# Download NodeJS bundle +ADD https://nodejs.org/download/release/v14.21.3/node-v14.21.3-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 LABEL maintainer="wekan" LABEL org.opencontainers.image.ref.name="ubuntu" -LABEL org.opencontainers.image.version="24.10" +LABEL org.opencontainers.image.version="24.04" LABEL org.opencontainers.image.source="https://github.com/wekan/wekan" -# 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 \ +# Set default environment variables +ENV WITH_API=true \ RESULTS_PER_PAGE="" \ DEFAULT_BOARD_ID="" \ ACCOUNTS_LOCKOUT_KNOWN_USERS_FAILURES_BEFORE=3 \ @@ -158,119 +203,35 @@ ENV \ WRITABLE_PATH=/data \ S3="" -# 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 <