From 06caab9d561fb629a52301543f56475c1c054f81 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 12 Oct 2022 10:22:53 +0200 Subject: [PATCH 1/2] Rebase production Docker image on debian The Alpine one can't be built against arm/arm64 anymore Signed-off-by: Thomas Citharel --- docker/production/Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 From 19a17494ae13f6f21fd220683dd67fe3efa575e9 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 12 Oct 2022 10:24:21 +0200 Subject: [PATCH 2/2] Allow docker build on main branch to be triggered Signed-off-by: Thomas Citharel --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 .