Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
chore: more enhancements to Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
brecke committed Nov 4, 2019
1 parent 89b1acf commit 73ab384
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,44 @@ RUN chmod +x /entrypoint.sh \
&& sed -i -e '96 s,if.*,if [ "${VERSION#v}" = "$NEEDED_VERSION" ]; then,' ${ETHERPAD_PATH}/bin/installDeps.sh \
&& ${ETHERPAD_PATH}/bin/installDeps.sh \
&& rm -rf /tmp/*
COPY settings.json /opt/etherpad/settings.json
RUN chown -R etherpad:etherpad ${ETHERPAD_PATH}

# Set workdir for all commands below
WORKDIR ${ETHERPAD_PATH}

COPY settings.json settings.json
RUN chown -R etherpad:etherpad .

# Install ep_headings module
RUN cd ${ETHERPAD_PATH} && npm install ep_headings
RUN npm install ep_headings

# Install ep_comments module
RUN cd ${ETHERPAD_PATH} \
&& npm install ep_page_view \
RUN npm install ep_page_view \
&& git clone https://github.com/oaeproject/ep_comments.git node_modules/ep_comments_page \
&& cd node_modules/ep_comments_page \
&& npm install

# Etherpad OAE plugin
RUN cd ${ETHERPAD_PATH}/node_modules \
RUN cd node_modules \
&& git clone https://github.com/oaeproject/ep_oae \
&& cd ep_oae \
&& npm install

# CSS changes
RUN rm ${ETHERPAD_PATH}/node_modules/ep_headings/templates/editbarButtons.ejs && cp ${ETHERPAD_PATH}/node_modules/ep_oae/static/templates/editbarButtons.ejs ${ETHERPAD_PATH}/node_modules/ep_headings/templates/editbarButtons.ejs
RUN rm ${ETHERPAD_PATH}/src/static/custom/pad.css && cp ${ETHERPAD_PATH}/node_modules/ep_oae/static/css/pad.css ${ETHERPAD_PATH}/src/static/custom/pad.css
RUN rm node_modules/ep_headings/templates/editbarButtons.ejs && cp node_modules/ep_oae/static/templates/editbarButtons.ejs node_modules/ep_headings/templates/editbarButtons.ejs
RUN rm src/static/custom/pad.css && cp node_modules/ep_oae/static/css/pad.css src/static/custom/pad.css

# Must add the same key as config.js
RUN echo "13SirapH8t3kxUh5T5aqWXhXahMzoZRA" > ${ETHERPAD_PATH}/APIKEY.txt
RUN echo "cocoxixi" > ${ETHERPAD_PATH}/SESSIONKEY.txt
RUN echo "13SirapH8t3kxUh5T5aqWXhXahMzoZRA" > APIKEY.txt
RUN echo "cocoxixi" > SESSIONKEY.txt

# Install PM2
RUN npm install --global pm2

# Set the right permissions
RUN chown -R etherpad:etherpad settings.json var
RUN chmod 755 settings.json

EXPOSE 9001
RUN chown -R etherpad:etherpad ${ETHERPAD_PATH}/settings.json ${ETHERPAD_PATH}/var
RUN chmod 755 ${ETHERPAD_PATH}/settings.json

# Running with PM2
CMD ["sh", "-c", "cd ${ETHERPAD_PATH} && pm2 start --restart-delay=3000 node_modules/ep_etherpad-lite/node/server.js && pm2 logs"]
CMD ["sh", "-c", "pm2 start --restart-delay=3000 node_modules/ep_etherpad-lite/node/server.js && pm2 logs"]

1 comment on commit 73ab384

@datreeio
Copy link

@datreeio datreeio bot commented on 73ab384 Nov 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Rules (5 / 5) Passed

👑 Good job! this pull request is aligned with your organization's best practices!

👉 You can review your rules settings at smart policy management 👈

👉 click here to view a full list of the events 👈

Please sign in to comment.