From 61a55dbcfab679e1dd0048ad78ae87d8d4f3f30e Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Sun, 7 Nov 2021 20:57:49 +0200 Subject: [PATCH] Initial import --- .env.sample | 7 +++++++ compose.yml | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .env.sample create mode 100644 compose.yml diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..857df8f --- /dev/null +++ b/.env.sample @@ -0,0 +1,7 @@ +TYPE=cryptpad + +DOMAIN=cryptpad.example.com + +## Domain aliases +#EXTRA_DOMAINS=', `www.cryptpad.example.com`' +LETS_ENCRYPT_ENV=production diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..8a533ec --- /dev/null +++ b/compose.yml @@ -0,0 +1,54 @@ +--- +version: "3.8" + +services: + app: + image: promasu/cryptpad:nginx + networks: + - proxy + environment: + - "CPAD_MAIN_DOMAIN=$DOMAIN" + - "CPAD_SANDBOX_DOMAIN=sandbox.$DOMAIN" + # Traefik can't use HTTP2 to communicate with cryptpat_websocket + # A workaroung is disabling HTTP2 in Nginx + - CPAD_HTTP2_DISABLE=true + + volumes: + - cryptpad_blob:/cryptpad/blob + - cryptpad_block:/cryptpad/block + - cryptpad_customize:/cryptpad/customize + - cryptpad_data:/cryptpad/data + - cryptpad_files:/cryptpad/datastore + - cryptpad_config:/cryptpad/config/ + + deploy: + restart_policy: + condition: on-failure + labels: + - "traefik.enable=true" + - "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80" + - "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})" + - "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure" + - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}" + ## Redirect from EXTRA_DOMAINS to DOMAIN + #- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect" + #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true" + #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}" + # healthcheck: + # test: ["CMD", "curl", "-f", "http://localhost"] + # interval: 30s + # timeout: 10s + # retries: 10 + # start_period: 1m + +networks: + proxy: + external: true + +volumes: + cryptpad_blob: + cryptpad_block: + cryptpad_customize: + cryptpad_data: + cryptpad_files: + cryptpad_config: