Docker image for updating site

This commit is contained in:
Stefan Schlott 2022-08-26 18:30:50 +02:00
parent 422462ec6e
commit 3686d1c9d7
4 changed files with 63 additions and 0 deletions

19
Dockerfile-siteupdate Normal file
View file

@ -0,0 +1,19 @@
FROM ruby:2-bullseye
COPY Gemfile* /tmp/
RUN cd /tmp && bundle install && rm Gemfile*
RUN apt-get update && apt-get install -y rsync git && rm -rf /var/lib/apt/lists/*
COPY scripts/update-site.sh /usr/local/bin/
# Home directory of user, containing ssh keys, etc.
VOLUME /data
# Website source
ENV WEBSITE_SOURCE=/website-source
VOLUME /website-source
# Compiled website
VOLUME /website
RUN useradd -M -d /data siteupdate && chown siteupdate:siteupdate /data /website-source /website
USER siteupdate:siteupdate
WORKDIR /data
CMD /usr/local/bin/update-site.sh