diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b9079272..ccd478cfb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -223,7 +223,7 @@ build-docker-main: rules: - if: '$CI_PROJECT_NAMESPACE != "framasoft"' when: never - - if: '$CI_PIPELINE_SOURCE == "schedule"' + - if: '$CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_TRIGGERED == "true"' script: - docker buildx build --push --platform linux/amd64 -t framasoft/mobilizon:main -f docker/production/Dockerfile . diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile index 7f19b640f..b1bd2dbcf 100644 --- a/docker/production/Dockerfile +++ b/docker/production/Dockerfile @@ -1,7 +1,7 @@ # First build the application assets -FROM node:16-alpine as assets +FROM node:16 as assets -RUN apk add --no-cache python3 build-base libwebp-tools bash imagemagick ncurses +RUN apt update && apt dist-upgrade -y && apt install -y python3 build-essential bash imagemagick libncurses5 WORKDIR /build COPY js . @@ -10,9 +10,9 @@ RUN yarn install --network-timeout 100000 \ && yarn run build # Then, build the application binary -FROM elixir:1.14-alpine AS builder +FROM elixir:1.14 AS builder -RUN apk add --no-cache build-base git cmake +RUN apt update && apt dist-upgrade -y && apt install -y build-essential git cmake COPY mix.exs mix.lock ./ ENV MIX_ENV=prod @@ -32,7 +32,7 @@ RUN mix phx.digest.clean --all \ && mix release # Finally setup the app -FROM alpine +FROM debian:bullseye-slim ARG BUILD_DATE ARG VCS_REF @@ -47,7 +47,7 @@ LABEL org.opencontainers.image.title="mobilizon" \ org.opencontainers.image.revision=$VCS_REF \ org.opencontainers.image.created=$BUILD_DATE -RUN apk add --no-cache curl openssl ca-certificates ncurses-libs file postgresql-client libgcc libstdc++ imagemagick python3 py3-pip py3-pillow py3-cffi py3-brotli gcc g++ musl-dev python3-dev pango libxslt-dev ttf-cantarell +RUN apt update && apt dist-upgrade -y && apt install -y curl openssl ca-certificates libncurses5 file postgresql-client gcc g++ imagemagick python3 python3-pip python3-pillow python3-cffi python3-brotli python3-dev libpango-1.0-0 libxslt-dev fonts-cantarell && rm -rf /var/lib/apt RUN pip install weasyprint pyexcel-ods3 RUN mkdir -p /var/lib/mobilizon/uploads && chown nobody:nobody /var/lib/mobilizon/uploads