Created
August 30, 2021 12:40
-
-
Save rpodcast/df195c5c037b222d2fc812ecb840d46a to your computer and use it in GitHub Desktop.
hedgedoc in docker containers with swag for reverse proxy
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
version: "3" | |
services: | |
mariadb: | |
image: ghcr.io/linuxserver/mariadb:latest | |
container_name: hedgedoc_mariadb | |
restart: always | |
volumes: | |
- /home/eric/docker_configs/hedgedoc/mariadb:/config | |
environment: | |
- MYSQL_ROOT_PASSWORD=mypass123** | |
- MYSQL_DATABASE=hedgedoc | |
- MYSQL_USER=hedgedoc | |
- MYSQL_PASSWORD=mypass123** | |
- PGID=1000 | |
- PUID=1000 | |
- TZ=America/New_York | |
hedgedoc: | |
image: ghcr.io/linuxserver/hedgedoc:latest | |
container_name: hedgedoc | |
restart: always | |
depends_on: | |
- mariadb | |
volumes: | |
- /home/eric/docker_configs/hedgedoc/config:/config | |
environment: | |
- DB_HOST=mariadb | |
- DB_USER=hedgedoc | |
- DB_PASS=mypass123** | |
- DB_NAME=hedgedoc | |
- DB_PORT=3306 | |
- PGID=1000 | |
- PUID=1000 | |
- TZ=America/New_York | |
- CMD_DOMAIN=mydomain.io | |
- CMD_PROTOCOL_USESSL=true | |
- CMD_GITHUB_CLIENTID=aaaaaaaaaaaaaaaaa | |
- CMD_GITHUB_CLIENTSECRET=bbbbbbbbbbbbbbbbbbbbbbbb | |
ports: | |
- "3000:3000" | |
swag: | |
image: ghcr.io/linuxserver/swag | |
container_name: swag | |
cap_add: | |
- NET_ADMIN | |
environment: | |
- PUID=1000 | |
- PGID=1000 | |
- TZ=America/New_York | |
- URL=mydomain.io | |
- SUBDOMAINS= | |
- VALIDATION=http | |
- DNSPLUGIN=cloudflare #optional | |
- PROPAGATION= #optional | |
- DUCKDNSTOKEN= #optional | |
- [email protected] | |
- ONLY_SUBDOMAINS=false #optional | |
- EXTRA_DOMAINS= #optional | |
- STAGING=false #optional | |
volumes: | |
- /home/eric/docker_configs/swag/config:/config | |
ports: | |
- "443:443" | |
- "80:80" | |
restart: "unless-stopped" |
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
## Version 2021/05/18 | |
# make sure you have added the following environmental variables to your run command/compose file | |
# CMD_DOMAIN=codimd.server.com | |
# CMD_PROTOCOL_USESSL=true | |
server { | |
listen 443 ssl; | |
listen [::]:443 ssl; | |
server_name hedgedoc.*; | |
include /config/nginx/ssl.conf; | |
client_max_body_size 0; | |
# enable for ldap auth, fill in ldap details in ldap.conf | |
#include /config/nginx/ldap.conf; | |
# enable for Authelia | |
#include /config/nginx/authelia-server.conf; | |
location / { | |
# enable the next two lines for http auth | |
#auth_basic "Restricted"; | |
#auth_basic_user_file /config/nginx/.htpasswd; | |
# enable the next two lines for ldap auth | |
#auth_request /auth; | |
#error_page 401 =200 /ldaplogin; | |
# enable for Authelia | |
#include /config/nginx/authelia-location.conf; | |
include /config/nginx/proxy.conf; | |
resolver 127.0.0.11 valid=30s; | |
set $upstream_app hedgedoc; | |
set $upstream_port 3000; | |
set $upstream_proto http; | |
proxy_pass $upstream_proto://$upstream_app:$upstream_port; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment