diff --git a/pica-etherpad/Dockerfile b/pica-etherpad/Dockerfile index 7c564e585dc88a96751739970b9fa55c1f95cb95..3c3e9c6b6b7d4cca4cc4d6275cf45cfa7820cefa 100644 --- a/pica-etherpad/Dockerfile +++ b/pica-etherpad/Dockerfile @@ -32,7 +32,6 @@ RUN curl -SL https://github.com/ether/etherpad-lite/archive/${ETHERPAD_VERSION}. rm -Rf etherpad.zip etherpad-lite-${ETHERPAD_VERSION}/.git && \ mv etherpad-lite-${ETHERPAD_VERSION}/* . && \ mkdir -p src/templates && \ - mkdir -p static && \ bin/installDeps.sh && \ rm settings.json && \ npm install \ @@ -53,16 +52,16 @@ RUN curl -SL https://github.com/ether/etherpad-lite/archive/${ETHERPAD_VERSION}. git clone https://framagit.org/DeBugs/picasoft-etherpad-landing-page.git src/templates/picasoft-etherpad-landing-page && \ git --git-dir=src/templates/picasoft-etherpad-landing-page/.git checkout ${ETHERPAD_LANDING_PAGE_VERSION} && \ cp src/templates/picasoft-etherpad-landing-page/index.html src/templates/index.html && \ - cp src/templates/picasoft-etherpad-landing-page/static/* static/ -r + cp src/templates/picasoft-etherpad-landing-page/static/* src/static/ -r # construction de l'image finale FROM base -COPY entrypoint.sh /entrypoint.sh +COPY entrypoint.sh /opt/etherpad-lite/entrypoint.sh RUN apt-get update && \ apt-get install -y mysql-client && \ - chmod +x /entrypoint.sh && \ + chmod +x /opt/etherpad-lite/entrypoint.sh && \ mkdir -p /opt/etherpad-lite && \ chown -R node /opt/etherpad-lite && \ usermod -d /opt/etherpad-lite node && \ @@ -71,7 +70,8 @@ RUN apt-get update && \ # import des fichiers téléchargés dans l'image downloader COPY --from=downloader --chown=node /opt/etherpad-lite /opt/etherpad-lite/ -ENTRYPOINT ["/entrypoint.sh"] +USER node +ENTRYPOINT ["/opt/etherpad-lite/entrypoint.sh"] CMD /bin/bash -c "/opt/etherpad-lite/bin/run.sh" HEALTHCHECK CMD curl -s 127.0.0.1:${ETHERPAD_PORT:=8080} diff --git a/pica-etherpad/entrypoint.sh b/pica-etherpad/entrypoint.sh index a755617a92b412b5e22054ba6c07bc8ef00877e9..4ea208bc1860464b82b7031c2485225019828363 100644 --- a/pica-etherpad/entrypoint.sh +++ b/pica-etherpad/entrypoint.sh @@ -39,9 +39,9 @@ if [ "$RESULT" != $ETHERPAD_DB_NAME ]; then -e "create database ${ETHERPAD_DB_NAME}" fi -if [ ! -f settings.json ]; then +if [ ! -f /opt/etherpad-lite/settings.json ]; then - cat <<- EOF > settings.json + cat <<- EOF > /opt/etherpad-lite/settings.json { "title": "${ETHERPAD_TITLE}", "ip": "0.0.0.0", @@ -60,7 +60,7 @@ if [ ! -f settings.json ]; then : ${ETHERPAD_ADMIN_USER:=admin} - cat <<- EOF >> settings.json + cat <<- EOF >> /opt/etherpad-lite/settings.json "users": { "${ETHERPAD_ADMIN_USER}": { "password": "${ETHERPAD_ADMIN_PASSWORD}", @@ -70,7 +70,7 @@ if [ ! -f settings.json ]; then EOF fi - cat <<- EOF >> settings.json + cat <<- EOF >> /opt/etherpad-lite/settings.json } EOF fi