From 34f853159e5964e16712232388cd4ae203fdf72b Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 22 May 2023 18:44:21 +0200 Subject: [PATCH 1/2] build(docker): Fix production Dockerfile Make sure every data folder properly exists See https://forge.tedomum.net/tedomum/mobilizon/-/issues/14 Signed-off-by: Thomas Citharel --- docker/production/Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile index 9a84bd9fb..1b5370e5b 100644 --- a/docker/production/Dockerfile +++ b/docker/production/Dockerfile @@ -1,5 +1,5 @@ # First build the application assets -FROM node:16-alpine as assets +FROM node:18-alpine as assets RUN apk add --no-cache python3 build-base libwebp-tools bash imagemagick ncurses WORKDIR /build @@ -49,11 +49,17 @@ LABEL org.opencontainers.image.title="mobilizon" \ 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 openssl1.1-compat RUN pip install weasyprint pyexcel-ods3 +# Create every data directory RUN mkdir -p /var/lib/mobilizon/uploads && chown nobody:nobody /var/lib/mobilizon/uploads +RUN mkdir -p /var/lib/mobilizon/timezones && chown nobody:nobody /var/lib/mobilizon/timezones +RUN mkdir -p /var/lib/mobilizon/tzdata && chown nobody:nobody /var/lib/mobilizon/tzdata RUN mkdir -p /var/lib/mobilizon/uploads/exports/{csv,pdf,ods} && chown -R nobody:nobody /var/lib/mobilizon/uploads/exports -RUN mkdir -p /var/lib/mobilizon/timezones + +# Get timezone geodata RUN curl -L 'https://packages.joinmobilizon.org/tz_world/timezones-geodata.dets' -o /var/lib/mobilizon/timezones/timezones-geodata.dets -RUN chown nobody:nobody /var/lib/mobilizon/timezones +RUN chown -R nobody:nobody /var/lib/mobilizon/timezones + +# Create configuration directory RUN mkdir -p /etc/mobilizon && chown nobody:nobody /etc/mobilizon USER nobody From 43eab9e680f36350faba70baec2ac07711ad61d9 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 22 May 2023 18:53:22 +0200 Subject: [PATCH 2/2] build(docker-tests): Update test container Signed-off-by: Thomas Citharel --- docker/tests/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/tests/Dockerfile b/docker/tests/Dockerfile index 6342d6847..f9687894a 100644 --- a/docker/tests/Dockerfile +++ b/docker/tests/Dockerfile @@ -1,9 +1,9 @@ FROM elixir:latest LABEL maintainer="Thomas Citharel " -ENV REFRESHED_AT=2022-09-20 +ENV REFRESHED_AT=2023-05-22 RUN apt-get update -yq && apt-get install -yq build-essential inotify-tools postgresql-client git curl gnupg xvfb libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 cmake exiftool python3-pip python3-setuptools -RUN curl -sL https://deb.nodesource.com/setup_16.x | bash && apt-get install nodejs -yq +RUN curl -sL https://deb.nodesource.com/setup_18.x | bash && apt-get install nodejs -yq RUN npm install -g yarn wait-on RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN mix local.hex --force && mix local.rebar --force