From ade78edafbadeb79cf388dfc908de5b773a9a61a Mon Sep 17 00:00:00 2001 From: m1ka Date: Sun, 19 Jul 2026 19:01:46 +0200 Subject: [PATCH] backport docker from previous mainline commit --- Dockerfile | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7617c25c5fe1acad855cdf5ab3f4f236f3105724..8740c972e8a23296a4cd12710c95d3083d40f282 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,40 +1,43 @@ -FROM alpine:3 -RUN apk add --no-cache elixir nginx git rust cargo nodejs npm tzdata -RUN ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime -COPY nginx.conf /etc/nginx/nginx.conf - -# setup folders -RUN mkdir -p /data/www -RUN adduser -D -g 'www' www -RUN chown -R www:www /var/lib/nginx +# [[ META-BUILDER ]] -# build fxg -WORKDIR "/usr/local/fxg" -COPY fxg . -RUN cargo build --release -RUN cp target/release/fxg /usr/local/bin +FROM alpine:3 AS kethel +RUN apk add --no-cache elixir git tzdata nodejs npm +RUN ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime # fetch deps WORKDIR "/usr/local/app" COPY pull-hljs.sh . RUN ./pull-hljs.sh WORKDIR "/usr/local/app/kethel" -COPY kethel/mix.exs kethel/mix.lock kethel/package.json kethel/package-lock.json ./ +COPY kethel ./ RUN npm i # build www.m1kadev.nl WORKDIR "/usr/local/app" -COPY . . + +COPY rss ./rss +COPY static ./static +COPY favicon.ico . + +COPY templates ./templates +COPY bricks ./bricks +COPY styles ./styles + +COPY scripts ./scripts +COPY pages ./pages +COPY thoughts ./thoughts + +COPY .git ./ + WORKDIR "/usr/local/app/kethel" RUN mix deps.get RUN mix compile.rambo + RUN mix run main.exs -- .. WORKDIR "/usr/local/app" -RUN cp -r build/* /data/www -WORKDIR "/data/www" -RUN chown -R www:www /data/www -RUN chmod -R 744 /data/www +# [[ SERVER ]] +FROM nginx:mainline AS server -# serve www.m1kadev.nl -CMD [ "nginx", "-c", "/etc/nginx/nginx.conf" ] +COPY --from=kethel /usr/local/app/build /usr/share/nginx/html +COPY nginx.conf /etc/nginx/nginx.conf