Commit 487ed4d0 authored by marioromera's avatar marioromera
Browse files

add services and dokerfile for etherpad

parent ad61fb25
......@@ -19,7 +19,7 @@ RUN apt-get install -y poppler-utils
COPY packages/server ./
COPY --from=build-client app/dist/ ./public/
RUN ls ./
RUN ls ./
RUN npm install
# Check files in final image
RUN ls ./
......
......@@ -11,11 +11,13 @@ services:
ports:
- 5000:5000
- 8000:8000
- 9001:9001
- 6379:6379
- 80:80
env_file:
- packages/server/.env
# Backup
volumes:
- ./backup-data:/uploads/
- ./logs:/logs
stdin_open: true
environment:
......@@ -23,9 +25,15 @@ services:
SERVER_PORT: 5000
WORKERS: 1
WS_PORT: 8000
# Change when known IP
# Currently set in .env file when built
VUE_APP_PROD_API_URL: http://193.170.194.211
# Reference: https://www.digitalocean.com/community/tutorials/how-to-secure-a-containerized-node-js-application-with-nginx-let-s-encrypt-and-docker-compose
# networks:
# - app-network
\ No newline at end of file
etherpad:
build: 'packages/etherpad'
ports:
- 6379:6379
- 9001:9001
redis:
image: "redis:alpine"
command: redis-server
ports:
- "6379:6379"
# Etherpad Lite Dockerfile
#
# https://github.com/ether/etherpad-lite
#
# Author: muxator
FROM node:10-buster-slim
LABEL maintainer="Etherpad team, https://github.com/ether/etherpad-lite"
# plugins to install while building the container. By default no plugins are
# installed.
# If given a value, it has to be a space-separated, quoted list of plugin names.
#
# EXAMPLE:
# ETHERPAD_PLUGINS="ep_codepad ep_author_neat"
ARG ETHERPAD_PLUGINS=
# By default, Etherpad container is built and run in "production" mode. This is
# leaner (development dependencies are not installed) and runs faster (among
# other things, assets are minified & compressed).
ENV NODE_ENV=production
# Follow the principle of least privilege: run as unprivileged user.
#
# Running as non-root enables running this image in platforms like OpenShift
# that do not allow images running as root.
RUN useradd --uid 5001 --create-home etherpad
RUN mkdir /opt/etherpad-lite && chown etherpad:0 /opt/etherpad-lite
USER etherpad
WORKDIR /opt/etherpad-lite
COPY --chown=etherpad:0 ./ ./
# install node dependencies for Etherpad
RUN bin/installDeps.sh && \
rm -rf ~/.npm/_cacache
# Install the plugins, if ETHERPAD_PLUGINS is not empty.
#
# Bash trick: in the for loop ${ETHERPAD_PLUGINS} is NOT quoted, in order to be
# able to split at spaces.
RUN for PLUGIN_NAME in ${ETHERPAD_PLUGINS}; do npm install "${PLUGIN_NAME}" || exit 1; done
# Copy the configuration file.
COPY --chown=etherpad:0 ./settings.json.docker /opt/etherpad-lite/settings.json
# Fix permissions for root group
RUN chmod -R g=u .
EXPOSE 9001
CMD ["node", "--experimental-worker", "node_modules/ep_etherpad-lite/node/server.js"]
\ No newline at end of file
......@@ -10,7 +10,7 @@ REQUIRED_NPM_MINOR=5
pecho() { printf %s\\n "$*"; }
log() { pecho "$@"; }
error() { log "ERROR: $@" >&2; }
error() { log "ERROR:" "$@" >&2; }
fatal() { error "$@"; exit 1; }
is_cmd() { command -v "$@" >/dev/null 2>&1; }
......
......@@ -4,9 +4,9 @@ WS_PORT=8000
SERVER_PORT=5000
ETHERPAD_PORT=9001
RPI_ETHERPAD_URL=localhost
DEV_ETHERPAD_URL=127.0.0.1
DEV_ETHERPAD_URL=localhost
ETHERPAD_RPI_API_KEY=0ee96c0c21cab2c92d817414589f3f4ebf13af96bf54318f4ff72065cca93d27
ETHERPAD_DEV_API_KEY=45a3ad5f451b8c0d179f940187f0e22656002c9c7bebc79cc2af75df964c56e7
ETHERPAD_PRODUCTION_API_KEY=047a5a0237a5982c6fff8293891ea3f27f4c792c225569a4d8b61ad96a24b8b3
REDIS_PORT=6379
REDIS_HOST=193.170.194.211
REDIS_HOST=localhost
......@@ -22,7 +22,6 @@ module.exports = io => {
socket.on('disconnect', function() {
logger.info('disconnecting socket', id);
clearInterval();
if (io.sockets.connected[id]) {
io.sockets.connected[id].disconnect();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment