Created
October 5, 2016 12:16
-
-
Save mlopezr/357ef70e5e20878f32267dfe81be5f91 to your computer and use it in GitHub Desktop.
Dockerfile for cryptpad that works behind port forwarding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:6 | |
# Should run as non-root user but currently can't make it to work behind a reverse proxy. Alternatives are: | |
# 1) Change source to show a different websocket port than the one listened: https://github.com/xwiki-labs/cryptpad/issues/42 | |
# 2) Tweak reverse proxy to rewrite GET /api/config responses | |
# 3) Expose server on port 80 within Docker container <-- simplest approach selected | |
# Create directories | |
RUN mkdir /data \ | |
&& mkdir -p /usr/src/app \ | |
# && useradd --home-dir /usr/src/app --no-create-home user \ | |
# && chown -R user:user /data \ | |
# && chown -R user:user /usr/src/app \ | |
&& npm install -g bower | |
#USER user | |
WORKDIR /usr/src/app | |
RUN git clone https://github.com/xwiki-labs/cryptpad.git . \ | |
&& mv customize.dist customize \ | |
&& rm customize/BottomBar.html \ | |
&& npm install --unsafe-perm \ | |
&& bower install --allow-root \ | |
&& sed "s/Port: 3000/Port: 80/g" config.js.dist > config.js | |
EXPOSE 80 | |
CMD [ "node", "server.js" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment