From 139499dec365849d0085d5646947c749a58ffb6a Mon Sep 17 00:00:00 2001 From: Gabriel Carneiro Date: Fri, 6 Dec 2024 11:15:24 -0300 Subject: [PATCH] initial commit --- .env.example | 10 +++++++ .gitignore | 1 + docker-compose.yml | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100755 docker-compose.yml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3cef76c --- /dev/null +++ b/.env.example @@ -0,0 +1,10 @@ +DOCKER_COMPOSE_APP_ADMIN_PASSWORD=admin +DOCKER_COMPOSE_APP_DB_CHARSET=utf8mb4 +DOCKER_COMPOSE_POSTGRES_DATABASE=etherpad +DOCKER_COMPOSE_POSTGRES_PASSWORD=admin +DOCKER_COMPOSE_POSTGRES_PORT=5432 +DOCKER_COMPOSE_POSTGRES_USER=admin +DOCKER_COMPOSE_APP_DEFAULT_PAD_TEXT=Alicepad +DOCKER_COMPOSE_APP_DISABLE_IP_LOGGING=false +DOCKER_COMPOSE_APP_SOFFICE=null +DOCKER_COMPOSE_APP_TRUST_PROXY=true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100755 index 0000000..cd9b319 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,68 @@ +services: + app: + user: "0:0" + image: etherpad/etherpad:latest + tty: true + stdin_open: true + volumes: + - plugins:/opt/etherpad-lite/src/plugin_packages + - etherpad-var:/opt/etherpad-lite/var + depends_on: + - postgres_pad + environment: + NODE_ENV: production + DB_TYPE: "postgres" + DB_HOST: postgres_pad + DB_NAME: ${DOCKER_COMPOSE_POSTGRES_DATABASE:-etherpad} + DB_PASS: ${DOCKER_COMPOSE_POSTGRES_PASSWORD:-admin} + DB_PORT: ${DOCKER_COMPOSE_POSTGRES_PORT:-5432} + DB_USER: ${DOCKER_COMPOSE_POSTGRES_USER:-admin} + ADMIN_PASSWORD: ${DOCKER_COMPOSE_APP_ADMIN_PASSWORD:-admin} + DB_CHARSET: ${DOCKER_COMPOSE_APP_DB_CHARSET:-utf8mb4} + + # For now, the env var DEFAULT_PAD_TEXT cannot be unset or empty; it seems to be mandatory in the latest version of etherpad + DEFAULT_PAD_TEXT: ${DOCKER_COMPOSE_APP_DEFAULT_PAD_TEXT:- } + DISABLE_IP_LOGGING: ${DOCKER_COMPOSE_APP_DISABLE_IP_LOGGING:-false} + SOFFICE: ${DOCKER_COMPOSE_APP_SOFFICE:-null} + TRUST_PROXY: ${DOCKER_COMPOSE_APP_TRUST_PROXY:-true} + SKIN_VARIANTS: "super-dark-toolbar dark-background super-dark-editor" + restart: always + # ports: + # - "${DOCKER_COMPOSE_APP_PORT_PUBLISHED:-9001}:${DOCKER_COMPOSE_APP_PORT_TARGET:-9001}" + networks: + - traefik-public + labels: + traefik.enable: true + traefik.port: 9001 + traefik.http.routers.etherpad.rule: Host(`pad.alice.ufsj.edu.br`) + traefik.http.services.etherpad.loadbalancer: 9001 + traefik.http.services.etherpad.loadbalancer.passhostheader: true + traefik.http.routers.etherpad.middlewares: sslheader + traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto: https + + postgres_pad: + image: postgres:15-alpine + environment: + POSTGRES_DB: ${DOCKER_COMPOSE_POSTGRES_DATABASE:-etherpad} + POSTGRES_PASSWORD: ${DOCKER_COMPOSE_POSTGRES_PASSWORD:-admin} + POSTGRES_PORT: ${DOCKER_COMPOSE_POSTGRES_PORT:-5432} + POSTGRES_USER: ${DOCKER_COMPOSE_POSTGRES_USER:-admin} + PGDATA: /var/lib/postgresql/data/pgdata + restart: always + networks: + - traefik-public + # Exposing the port is not needed unless you want to access this database instance from the host. + # Be careful when other postgres docker container are running on the same port + # ports: + # - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data/pgdata + +volumes: + postgres_data: + plugins: + etherpad-var: + +networks: + traefik-public: + external: true