feat: Run as user & fix plugin issues

This commit is contained in:
Glenn Y. Rolland 2022-05-08 21:01:32 +02:00
parent a850f2ceff
commit 9304d4ce07

View file

@ -5,45 +5,59 @@ MAINTAINER Glenn Y. Rolland <glenux@glenux.net>
ENV ETHERPAD_VERSION 1.8.18 ENV ETHERPAD_VERSION 1.8.18
# RUN = docker run ... + docker commit
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y curl unzip mariadb-client netcat \ && apt-get install -y unzip mariadb-client netcat \
&& apt-get clean \ && apt-get clean \
&& rm -r /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
WORKDIR /opt/ RUN cd /opt \
&& wget \
RUN curl -SL \
https://github.com/ether/etherpad-lite/archive/${ETHERPAD_VERSION}.zip \ https://github.com/ether/etherpad-lite/archive/${ETHERPAD_VERSION}.zip \
> etherpad.zip && unzip etherpad \ -O etherpad.zip \
&& unzip etherpad \
&& rm etherpad.zip \ && rm etherpad.zip \
&& mv etherpad-lite-${ETHERPAD_VERSION} etherpad-lite && mv etherpad-lite-${ETHERPAD_VERSION} etherpad \
&& useradd --home-dir /opt/etherpad etherpad \
&& chown -R etherpad:etherpad /opt/etherpad
WORKDIR /opt/etherpad-lite COPY --chown=etherpad parseurl.sh /parseurl.sh
COPY --chown=etherpad entrypoint.sh /entrypoint.sh
COPY parseurl.py /parseurl.py
COPY entrypoint.sh /entrypoint.sh
# Pre-install WORKDIR /opt/etherpad
RUN chmod +x /entrypoint.sh \ USER etherpad
&& npm install \
ep_author_neat ep_headings2 \ # Pre-install some plugins
ep_set_title_on_pad ep_adminpads \ RUN bin/installDeps.sh \
ep_workspaces ep_comments_page \ && cd src \
ep_font_color ep_table_of_contents \ && npm install --save-prod \
ep_delete_after_delay \ github:alxndr42/ep_expiration \
ep_author_neat \
ep_headings2 \
ep_comments_page \
ep_font_color \
ep_offline_edit \ ep_offline_edit \
ep_prompt_for_name \ ep_prompt_for_name \
&& bin/installDeps.sh \ ep_workspaces \
&& sed -i 's/^node/exec\ node/' bin/run.sh \ ep_table_of_contents \
ep_adminpads \
&& cd .. \
&& rm settings.json \ && rm settings.json \
&& ln -s var/settings.json settings.json && ln -s var/settings.json settings.json
# ep_delete_after_delay \
# ep_set_title_on_pad \
# && sed -i 's/^node/exec\ node/' bin/run.sh \
# ep_mypads # ep_mypads
# meta-données # meta-données
VOLUME /opt/etherpad-lite/var VOLUME /opt/etherpad/var
EXPOSE 9001 EXPOSE 9001
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bin/run.sh", "--root"] ENTRYPOINT ["/entrypoint.sh"]
CMD ["./src/bin/run.sh"]
# bin/run.sh