From ff55ea012d82be20bf798300d3c9c46c7d98eb4e Mon Sep 17 00:00:00 2001 From: Gurulandia Date: Wed, 5 Feb 2025 20:29:47 +0200 Subject: [PATCH] Initial Commit --- docker/compose/joplin-server.yaml | 18 +++ docker/compose/networks.yaml | 20 +++ docker/compose/networks/backend.yaml | 4 + docker/compose/networks/default.yaml | 4 + docker/compose/networks/proxy.yaml | 4 + docker/compose/networks/socket-proxy.yaml | 4 + docker/compose/postgres.yaml | 10 ++ docker/env/.env.common | 14 ++ docker/env/.env.joplin-srv | 27 ++++ docker/env/.env.joplin-srv.db-cred | 3 + docker/env/.env.joplin-srv.withdb | 2 + docker/env/.env.proxy | 14 ++ docker/env/.env.stack.joplin-srv | 16 ++ docker/env/.env.stack.proxy | 32 ++++ docker/jemma/.env | 31 ++++ docker/jemma/compose.yaml | 146 ++++++++++++++++++ .../behind-proxy-with-db/compose.override.yml | 25 +++ .../behind-proxy-with-db/compose.yml | 9 ++ .../joplin-server/behind-proxy-with-db/dcc.sh | 1 + .../behind-proxy/compose.override.yml | 13 ++ docker/joplin-server/behind-proxy/compose.yml | 7 + docker/joplin-server/behind-proxy/dcc.sh | 1 + docker/joplin-server/compose.yml | 7 + docker/joplin-server/dcc.sh | 1 + .../with-db/compose.override.yml | 18 +++ docker/joplin-server/with-db/compose.yml | 8 + docker/joplin-server/with-db/dcc.sh | 1 + docker/services/dc-joplin-server.yml | 93 +++++++++++ 28 files changed, 533 insertions(+) create mode 100644 docker/compose/joplin-server.yaml create mode 100644 docker/compose/networks.yaml create mode 100644 docker/compose/networks/backend.yaml create mode 100644 docker/compose/networks/default.yaml create mode 100644 docker/compose/networks/proxy.yaml create mode 100644 docker/compose/networks/socket-proxy.yaml create mode 100644 docker/compose/postgres.yaml create mode 100644 docker/env/.env.common create mode 100644 docker/env/.env.joplin-srv create mode 100644 docker/env/.env.joplin-srv.db-cred create mode 100644 docker/env/.env.joplin-srv.withdb create mode 100644 docker/env/.env.proxy create mode 100644 docker/env/.env.stack.joplin-srv create mode 100644 docker/env/.env.stack.proxy create mode 100644 docker/jemma/.env create mode 100644 docker/jemma/compose.yaml create mode 100644 docker/joplin-server/behind-proxy-with-db/compose.override.yml create mode 100644 docker/joplin-server/behind-proxy-with-db/compose.yml create mode 100755 docker/joplin-server/behind-proxy-with-db/dcc.sh create mode 100644 docker/joplin-server/behind-proxy/compose.override.yml create mode 100644 docker/joplin-server/behind-proxy/compose.yml create mode 100755 docker/joplin-server/behind-proxy/dcc.sh create mode 100644 docker/joplin-server/compose.yml create mode 100755 docker/joplin-server/dcc.sh create mode 100644 docker/joplin-server/with-db/compose.override.yml create mode 100644 docker/joplin-server/with-db/compose.yml create mode 100755 docker/joplin-server/with-db/dcc.sh create mode 100644 docker/services/dc-joplin-server.yml diff --git a/docker/compose/joplin-server.yaml b/docker/compose/joplin-server.yaml new file mode 100644 index 0000000..c84fb0e --- /dev/null +++ b/docker/compose/joplin-server.yaml @@ -0,0 +1,18 @@ +services: + joplin-server: + image: ${JOPLIN_IMAGE}:${JOPLIN_TAG} + container_name: ${JOPLIN_CONTAINER_NAME} + restart: ${JOPLIN_RESTART_POLICY} + security_opt: + - no-new-privileges:true + networks: + - ${JOPLIN_NETWORk_ID} +# ports: +# - "22300:22300" + environment: + UID: ${UID:-1000} + GID: ${GID:-1000} + TZ: ${TZ} + env_file: + - path: ../env/.env.joplin-srv + - path: ../env/.env.joplin-srv.db-cred diff --git a/docker/compose/networks.yaml b/docker/compose/networks.yaml new file mode 100644 index 0000000..3c48ae5 --- /dev/null +++ b/docker/compose/networks.yaml @@ -0,0 +1,20 @@ +networks: + proy: + driver: bridge + #backendd: + # driver: bridge + socket_proxy: + driver: bridge + default: + driver: bridge +#networks: +# network1: +# external: true +# name: "${NETWORK_ID}" + +#networks: +# mynet1: +# labels: +# com.example.description: "Financial transaction network" +# com.example.department: "Finance" +# com.example.label-with-empty-value: "" \ No newline at end of file diff --git a/docker/compose/networks/backend.yaml b/docker/compose/networks/backend.yaml new file mode 100644 index 0000000..4be7b11 --- /dev/null +++ b/docker/compose/networks/backend.yaml @@ -0,0 +1,4 @@ +networks: + backend: + name: backend + driver: bridge \ No newline at end of file diff --git a/docker/compose/networks/default.yaml b/docker/compose/networks/default.yaml new file mode 100644 index 0000000..7961d45 --- /dev/null +++ b/docker/compose/networks/default.yaml @@ -0,0 +1,4 @@ +networks: + default: +# name: default + driver: bridge diff --git a/docker/compose/networks/proxy.yaml b/docker/compose/networks/proxy.yaml new file mode 100644 index 0000000..d283986 --- /dev/null +++ b/docker/compose/networks/proxy.yaml @@ -0,0 +1,4 @@ +networks: + proxy: + name: proxy + driver: bridge \ No newline at end of file diff --git a/docker/compose/networks/socket-proxy.yaml b/docker/compose/networks/socket-proxy.yaml new file mode 100644 index 0000000..3c4262e --- /dev/null +++ b/docker/compose/networks/socket-proxy.yaml @@ -0,0 +1,4 @@ +networks: + socket_proxy: + name: socket_proxy + driver: bridge \ No newline at end of file diff --git a/docker/compose/postgres.yaml b/docker/compose/postgres.yaml new file mode 100644 index 0000000..5836207 --- /dev/null +++ b/docker/compose/postgres.yaml @@ -0,0 +1,10 @@ +services: + db: + image: postgres:16 + restart: unless-stopped + security_opt: + - no-new-privileges:true + volumes: + - ${DOCKERDIR}/${COMPOSE_PROJECT_NAME}/db:/var/lib/postgresql/data + #ports: + # - "5432:5432" \ No newline at end of file diff --git a/docker/env/.env.common b/docker/env/.env.common new file mode 100644 index 0000000..6797fca --- /dev/null +++ b/docker/env/.env.common @@ -0,0 +1,14 @@ +##### SYSTEM +UID=1000 +GID=1000 +TZ=Europe/HelsinkI + +#USERDIR=/home/gurulandia +DOCKERDIR=/gurulandia/data +SECRETSDIR=/gurulandia/docker-shared/secrets + +##### DOMAIN +DOMAINNAME0=gurulandia.eu +DOMAINNAME1=lab.gurulandia.eu +DOMAINNAME2=gurulandia.fi +DOMAINNAME3=home.gurulandia.fi \ No newline at end of file diff --git a/docker/env/.env.joplin-srv b/docker/env/.env.joplin-srv new file mode 100644 index 0000000..ef151c1 --- /dev/null +++ b/docker/env/.env.joplin-srv @@ -0,0 +1,27 @@ +# APP_BASE_URL: This is the base public URL where the service will be running. +# - If Joplin Server needs to be accessible over the internet, configure APP_BASE_URL as follows: https://example.com/joplin. +# - If Joplin Server does not need to be accessible over the internet, set the APP_BASE_URL to your server's hostname. +# For Example: http://[hostname]:22300. The base URL can include the port. +# APP_PORT: The local port on which the Docker container will listen. +# - This would typically be mapped to port to 443 (TLS) with a reverse proxy. +# - If Joplin Server does not need to be accessible over the internet, the port can be mapped to 22300. +#- APP_BASE_URL=http://10.0.6.177:22300 + +APP_BASE_URL=https://joplin.lab.gurulandia.eu +APP_PORT=53014 #22300 +# Database +DB_CLIENT=pg +POSTGRES_PORT=5432 +POSTGRES_HOST=10.0.6.178 + +#- STORAGE_DRIVER=Type=S3; Region=us-east-1; Path=http://192.168.55.30:53008; AccessKeyId=joplinsrv; SecretAccessKeyId=joplinsrv; Bucket=joplin + +# Mai8ler +MAILER_ENABLED=1 +MAILER_HOST=mailrise.lab.gurulandia.eu +MAILER_PORT=465 +MAILER_SECURITY=tls +MAILER_AUTH_USER=gurulandia +MAILER_AUTH_PASSWORD=gurulandia +MAILER_NOREPLY_NAME=JoplinServer +MAILER_NOREPLY_EMAIL=no-reply@mail.gurulandia.eu diff --git a/docker/env/.env.joplin-srv.db-cred b/docker/env/.env.joplin-srv.db-cred new file mode 100644 index 0000000..b5daa2f --- /dev/null +++ b/docker/env/.env.joplin-srv.db-cred @@ -0,0 +1,3 @@ +POSTGRES_PASSWORD=joplinsrv +POSTGRES_DATABASE=joplin +POSTGRES_USER=joplinsrv diff --git a/docker/env/.env.joplin-srv.withdb b/docker/env/.env.joplin-srv.withdb new file mode 100644 index 0000000..77a4296 --- /dev/null +++ b/docker/env/.env.joplin-srv.withdb @@ -0,0 +1,2 @@ +# Database +POSTGRES_HOST=db \ No newline at end of file diff --git a/docker/env/.env.proxy b/docker/env/.env.proxy new file mode 100644 index 0000000..20fcb59 --- /dev/null +++ b/docker/env/.env.proxy @@ -0,0 +1,14 @@ +BASICAUTHUSER=gurulandia:$$apr1$$kBqxEDFb$$aOgGWvLwFUDhSymDy430m. +# create basic auth with: echo $(htpasswd -nb "" "") | sed -e s/\\$/\\$\\$/g + +##### trustedIPs +CLOUDFLARE_IPS=173.245.48.0/20,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,141.101.64.0/18,108.162.192.0/18,190.93.240.0/20,188.114.96.0/20,197.234.240.0/22,198.41.128.0/17,162.158.0.0/15,172.64.0.0/13,131.0.72.0/22,104.16.0.0/13,104.24.0.0/14 +LOCAL_IPS=127.0.0.1/32,10.0.0.0/8,192.168.0.0/16,172.16.0.0/12 + +##### Certificate +CF_API_EMAIL=gurulandia@outlook.com + +CERTRESOLVER=dns-cloudflare +DNS_PROVIDER=cloudflare +RESOLVER0=1.1.1.1:53 +RESOLVER1=1.0.0.1:53 diff --git a/docker/env/.env.stack.joplin-srv b/docker/env/.env.stack.joplin-srv new file mode 100644 index 0000000..d6da9aa --- /dev/null +++ b/docker/env/.env.stack.joplin-srv @@ -0,0 +1,16 @@ +COMPOSE_PROJECT_NAME=joplinserver + +JOPLIN_NETWORk_ID=proxy +JOPLIN_HOSTNAME=joplin + +##### Joplin Server Container +JOPLIN_CONTAINER_NAME=joplinsrv +JOPLIN_IMAGE=joplin/server +JOPLIN_TAG=latest +JOPLIN_RESTART_POLICY=unless-stopped + +##### Joplin Server DB Container +JOPLINDB_CONTAINER_NAME=joplindb +JOPLINDB_IMAGE=postgres +JOPLINDB_TAG=16 +JOPLINDB_RESTART_POLICY=unless-stopped diff --git a/docker/env/.env.stack.proxy b/docker/env/.env.stack.proxy new file mode 100644 index 0000000..dc8bda1 --- /dev/null +++ b/docker/env/.env.stack.proxy @@ -0,0 +1,32 @@ +COMPOSE_PROJECT_NAME=proxy + +##### ProxyName +PROXYNAME=proxy + +##### Traefik Container +TRAEFIK_CONTAINER_NAME=traefik +TRAEFIK_IMAGE=traefik +TRAEFIK_TAG=latest +TRAEFIK_RESTART_POLICY=unless-stopped + +##### socket-proxy Container +SOCKET_PROXY_CONTAINER_NAME=socket-proxy +SOCKET_PROXY_IMAGE=ghcr.io/tecnativa/docker-socket-proxy +SOCKET_PROXY_TAG=latest +SOCKET_PROXY_RESTART_POLICY=always + +##### Crowdsec Container +CROWDSEC_CONTAINER_NAME=crowdsec +CROWDSEC_IMAGE=crowdsecurity/crowdsec +CROWDSEC_TAG=latest +CROWDSEC_RESTART_POLICY=unless-stopped + +##### bouncer-traefik Container +BT_CONTAINER_NAME=bouncer-traefik +BT_IMAGE=docker.io/fbonalair/traefik-crowdsec-bouncer +BT_TAG=latest +BT_RESTART_POLICY=unless-stopped + +GIN_MODE=release + +DOCKER_ENDPOINT=tcp://${SOCKET_PROXY_CONTAINER_NAME}:2375 \ No newline at end of file diff --git a/docker/jemma/.env b/docker/jemma/.env new file mode 100644 index 0000000..b89c4fc --- /dev/null +++ b/docker/jemma/.env @@ -0,0 +1,31 @@ +COMPOSE_PROJECT_NAME=joplinserver +COMPOSE_FILE=joplinserver.yaml +#COMPOSE_PROFILES +#COMPOSE_PROFILES=frontend,debug +COMPOSE_ENV_FILES=../env/.env.common #, ../env/joplinserver.env + +##### SYSTEM +PUID=1000 +PGID=1000 +TZ=Europe/HelsinkI + +#USERDIR=/home/gurulandia +DOCKERDIR=/gurulandia/data +SECRETSDIR=/gurulandia/docker-shared/secrets + +##### ProxyName +PROXYNAME=proxy + +##### Traefik Container +TRAEFIK_CONTAINER_NAME=traefik +TRAEFIK_IMAGE=traefik +TRAEFIK_VERSION=latest +TRAEFIK_RESTART_POLICY=unless-stopped + +##### socket-proxy Container +SOCKET_PROXY_CONTAINER_NAME=socket-proxy +SOCKET_PROXY_IMAGE=ghcr.io/tecnativa/docker-socket-proxy +SOCKET_PROXY_VERSION=latest +SOCKET_PROXY_RESTART_POLICY=always + +DOCKER_ENDPOINT=tcp://${SOCKET_PROXY_CONTAINER_NAME}:2375 diff --git a/docker/jemma/compose.yaml b/docker/jemma/compose.yaml new file mode 100644 index 0000000..d979e6c --- /dev/null +++ b/docker/jemma/compose.yaml @@ -0,0 +1,146 @@ +name: myapp +networks: + proxy: + name: proxy + external: true +# joplinsrv: +# name: joplinsrv +# driver: bridge +# This is a sample docker-compose file that can be used to run Joplin Server +# along with a PostgreSQL server. +# +# Update the following fields in the stanza below: +# +# POSTGRES_USER +# POSTGRES_PASSWORD +# APP_BASE_URL +# +# APP_BASE_URL: This is the base public URL where the service will be running. +# - If Joplin Server needs to be accessible over the internet, configure APP_BASE_URL as follows: https://example.com/joplin. +# - If Joplin Server does not need to be accessible over the internet, set the APP_BASE_URL to your server's hostname. +# For Example: http://[hostname]:22300. The base URL can include the port. +# APP_PORT: The local port on which the Docker container will listen. +# - This would typically be mapped to port to 443 (TLS) with a reverse proxy. +# - If Joplin Server does not need to be accessible over the internet, the port can be mapped to 22300. + +services: +# db: +# image: postgres:16 +# volumes: +# - ./data/postgres:/var/lib/postgresql/data +# ports: +# - "5432:5432" +# restart: unless-stopped +# environment: +# - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} +# - POSTGRES_USER=${POSTGRES_USER} +# - POSTGRES_DB=${POSTGRES_DATABASE} + app: + container_name: joplinsrv + image: joplin/server:latest +# depends_on: +# - db +# ports: +# - "22300:22300" + restart: unless-stopped + environment: + - APP_PORT=22300 + #- APP_BASE_URL=http://10.0.6.177:22300 + - APP_BASE_URL=https://joplin.lab.gurulandia.eu + - DB_CLIENT=pg + - POSTGRES_PASSWORD=joplinsrv + - POSTGRES_DATABASE=joplin + - POSTGRES_USER=joplinsrv + - POSTGRES_PORT=5432 + - POSTGRES_HOST=10.0.6.178 + #- STORAGE_DRIVER=Type=S3; Region=us-east-1; Path=http://192.168.55.30:53008; AccessKeyId=joplinsrv; SecretAccessKeyId=joplinsrv; Bucket=joplin + - MAILER_ENABLED=1 + - MAILER_HOST=mailrise.lab.gurulandia.eu + - MAILER_PORT=465 + - MAILER_SECURITY=tls + - MAILER_AUTH_USER=gurulandia + - MAILER_AUTH_PASSWORD=gurulandia + - MAILER_NOREPLY_NAME=JoplinServer + - MAILER_NOREPLY_EMAIL=my_email_address + networks: + - proxy + labels: + traefik.enable: true + ## HTTP Routers + traefik.http.routers.joplin-server-rtr.entrypoints: https + traefik.http.routers.joplin-server-rtr.rule: Host(`joplin.lab.gurulandia.eu`) + ## Middlewares + #- "traefik.http.routers.${GOTIFY_HOST_NAME}-rtr.middlewares=chain-authelia@file" + traefik.http.routers.joplinserver-rtr.middlewares: chain-no-auth@file + ## HTTP Services + traefik.http.routers.joplin-server-rtr.service: joplin-server-svc + traefik.http.services.joplin-server-svc.loadbalancer.server.port: 22300 + + # dns_search: + # - dc1.example.com + # - dc2.example.com + + # hostname: + +# +# one: +# label_file: ./app.labels +# +# two: +# label_file: +# - ./app.labels +# - ./additional.labels + +# dns: 8.8.8.8 + +# dns: +# - 8.8.8.8 +# - 9.9.9.9 +# domainname: + +# test_lib: +# image: test_lib_image +# profiles: +# - test + +# coverage_lib: +# image: coverage_lib_image +# depends_on: +# - test_lib +# profiles: +# - test + +# debug_lib: +# image: debug_lib_image +# depends_on: +# - test_lib +# profiles: +# - debug +#include: +# - my-compose-include.yaml #with serviceB declared +#services: +# serviceA: +# build: . +# depends_on: +# - serviceB #use serviceB directly as if it was declared in this Compose file + +#x-custom: +# foo: +# - bar +# - zot + +#networks: +# network1: +# external: true +# name: "${NETWORK_ID}" + +# depends_on: +# - crowdsec + +#include: +# - my-compose-include.yaml #with serviceB declared +#services: +# serviceA: +# build: . +# depends_on: +# - serviceB #use serviceB directly as if it was declared in this Compose file \ No newline at end of file diff --git a/docker/joplin-server/behind-proxy-with-db/compose.override.yml b/docker/joplin-server/behind-proxy-with-db/compose.override.yml new file mode 100644 index 0000000..817f42b --- /dev/null +++ b/docker/joplin-server/behind-proxy-with-db/compose.override.yml @@ -0,0 +1,25 @@ +services: + joplin-server: + labels: + - "traefik.enable=true" + ## HTTP Routers + - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.entrypoints=https" + - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.rule=Host(`${JOPLIN_HOSTNAME}.$DOMAINNAME1`)" + ## Middlewares +# - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.middlewares=chain-authelia@file" + - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.middlewares=chain-no-auth@file" + ## HTTP Services + - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.service=${JOPLIN_HOSTNAME}-svc" + - "traefik.http.services.${JOPLIN_HOSTNAME}-svc.loadbalancer.server.port=22300" + depends_on: + - db + env_file: + - path: ../../env/.env.joplin-srv.withdb + db: + image: ${JOPLINDB_IMAGE}:${JOPLINDB_TAG} + container_name: ${JOPLINDB_CONTAINER_NAME} + restart: ${JOPLINDB_RESTART_POLICY} + env_file: + - path: ../../env/.env.joplin-srv.db-cred + networks: + - ${JOPLIN_NETWORk_ID} \ No newline at end of file diff --git a/docker/joplin-server/behind-proxy-with-db/compose.yml b/docker/joplin-server/behind-proxy-with-db/compose.yml new file mode 100644 index 0000000..0c42c9f --- /dev/null +++ b/docker/joplin-server/behind-proxy-with-db/compose.yml @@ -0,0 +1,9 @@ +# Docker Compose v2.20 or greater required to use "include" +include: +#################### NETWORKS #################### + - ../../compose/networks/proxy.yaml + - ../../compose/networks/socket-proxy.yaml +#################### SERVICES #################### + - ../../compose/postgres.yaml + - ../../compose/joplin-server.yaml + \ No newline at end of file diff --git a/docker/joplin-server/behind-proxy-with-db/dcc.sh b/docker/joplin-server/behind-proxy-with-db/dcc.sh new file mode 100755 index 0000000..f68d8cf --- /dev/null +++ b/docker/joplin-server/behind-proxy-with-db/dcc.sh @@ -0,0 +1 @@ +docker compose --env-file ../../env/.env.stack.joplin-srv --env-file ../../env/.env.common config \ No newline at end of file diff --git a/docker/joplin-server/behind-proxy/compose.override.yml b/docker/joplin-server/behind-proxy/compose.override.yml new file mode 100644 index 0000000..60e2ef2 --- /dev/null +++ b/docker/joplin-server/behind-proxy/compose.override.yml @@ -0,0 +1,13 @@ +services: + joplin-server: + labels: + - "traefik.enable=true" + ## HTTP Routers + - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.entrypoints=https" + - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.rule=Host(`${JOPLIN_HOSTNAME}.$DOMAINNAME1`)" + ## Middlewares +# - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.middlewares=chain-authelia@file" + - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.middlewares=chain-no-auth@file" + ## HTTP Services + - "traefik.http.routers.${JOPLIN_HOSTNAME}-rtr.service=${JOPLIN_HOSTNAME}-svc" + - "traefik.http.services.${JOPLIN_HOSTNAME}-svc.loadbalancer.server.port=22300" diff --git a/docker/joplin-server/behind-proxy/compose.yml b/docker/joplin-server/behind-proxy/compose.yml new file mode 100644 index 0000000..318794e --- /dev/null +++ b/docker/joplin-server/behind-proxy/compose.yml @@ -0,0 +1,7 @@ +# Docker Compose v2.20 or greater required to use "include" +include: +#################### NETWORKS #################### + - ../../compose/networks/proxy.yaml + - ../../compose/networks/socket-proxy.yaml +#################### SERVICES #################### + - ../../compose/joplin-server.yaml diff --git a/docker/joplin-server/behind-proxy/dcc.sh b/docker/joplin-server/behind-proxy/dcc.sh new file mode 100755 index 0000000..f68d8cf --- /dev/null +++ b/docker/joplin-server/behind-proxy/dcc.sh @@ -0,0 +1 @@ +docker compose --env-file ../../env/.env.stack.joplin-srv --env-file ../../env/.env.common config \ No newline at end of file diff --git a/docker/joplin-server/compose.yml b/docker/joplin-server/compose.yml new file mode 100644 index 0000000..318794e --- /dev/null +++ b/docker/joplin-server/compose.yml @@ -0,0 +1,7 @@ +# Docker Compose v2.20 or greater required to use "include" +include: +#################### NETWORKS #################### + - ../../compose/networks/proxy.yaml + - ../../compose/networks/socket-proxy.yaml +#################### SERVICES #################### + - ../../compose/joplin-server.yaml diff --git a/docker/joplin-server/dcc.sh b/docker/joplin-server/dcc.sh new file mode 100755 index 0000000..63abb3f --- /dev/null +++ b/docker/joplin-server/dcc.sh @@ -0,0 +1 @@ +docker compose --env-file ../env/.env.stack.joplin-srv --env-file ../env/.env.common config \ No newline at end of file diff --git a/docker/joplin-server/with-db/compose.override.yml b/docker/joplin-server/with-db/compose.override.yml new file mode 100644 index 0000000..a5054db --- /dev/null +++ b/docker/joplin-server/with-db/compose.override.yml @@ -0,0 +1,18 @@ +services: + joplin-server: + depends_on: + - db +# ports: +# - "22300:22300" + env_file: + - path: ../../env/.env.joplin-srv.withdb + db: + image: ${JOPLINDB_IMAGE}:${JOPLINDB_TAG} + container_name: ${JOPLINDB_CONTAINER_NAME} + restart: ${JOPLINDB_RESTART_POLICY} + env_file: + - path: ../../env/.env.joplin-srv.db-cred +# ports: +# - "5432:5432" + networks: + - ${JOPLIN_NETWORk_ID} \ No newline at end of file diff --git a/docker/joplin-server/with-db/compose.yml b/docker/joplin-server/with-db/compose.yml new file mode 100644 index 0000000..e49df7e --- /dev/null +++ b/docker/joplin-server/with-db/compose.yml @@ -0,0 +1,8 @@ +# Docker Compose v2.20 or greater required to use "include" +include: +#################### NETWORKS #################### + - ../../compose/networks/proxy.yaml + - ../../compose/networks/socket-proxy.yaml +#################### SERVICES #################### + - ../../compose/postgres.yaml + - ../../compose/joplin-server.yaml diff --git a/docker/joplin-server/with-db/dcc.sh b/docker/joplin-server/with-db/dcc.sh new file mode 100755 index 0000000..f68d8cf --- /dev/null +++ b/docker/joplin-server/with-db/dcc.sh @@ -0,0 +1 @@ +docker compose --env-file ../../env/.env.stack.joplin-srv --env-file ../../env/.env.common config \ No newline at end of file diff --git a/docker/services/dc-joplin-server.yml b/docker/services/dc-joplin-server.yml new file mode 100644 index 0000000..d5fb732 --- /dev/null +++ b/docker/services/dc-joplin-server.yml @@ -0,0 +1,93 @@ +services: +# db: +# image: postgres:16 +# volumes: +# - ./data/postgres:/var/lib/postgresql/data +# ports: +# - "5432:5432" +# restart: unless-stopped +# environment: +# - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} +# - POSTGRES_USER=${POSTGRES_USER} +# - POSTGRES_DB=${POSTGRES_DATABASE} + app: + container_name: joplinsrv + image: joplin/server:latest +# depends_on: +# - db +# ports: +# - "22300:22300" + restart: unless-stopped + environment: + - APP_PORT=22300 + #- APP_BASE_URL=http://10.0.6.177:22300 + - APP_BASE_URL=https://joplin.lab.gurulandia.eu + - DB_CLIENT=pg + - POSTGRES_PASSWORD=joplinsrv + - POSTGRES_DATABASE=joplin + - POSTGRES_USER=joplinsrv + - POSTGRES_PORT=5432 + - POSTGRES_HOST=10.0.6.178 + #- STORAGE_DRIVER=Type=S3; Region=us-east-1; Path=http://192.168.55.30:53008; AccessKeyId=joplinsrv; SecretAccessKeyId=joplinsrv; Bucket=joplin + - MAILER_ENABLED=1 + - MAILER_HOST=mailrise.lab.gurulandia.eu + - MAILER_PORT=465 + - MAILER_SECURITY=tls + - MAILER_AUTH_USER=gurulandia + - MAILER_AUTH_PASSWORD=gurulandia + - MAILER_NOREPLY_NAME=JoplinServer + - MAILER_NOREPLY_EMAIL=my_email_address + networks: + - proxy + labels: + traefik.enable: true + ## HTTP Routers + traefik.http.routers.joplin-server-rtr.entrypoints: https + traefik.http.routers.joplin-server-rtr.rule: Host(`joplin.lab.gurulandia.eu`) + ## Middlewares + #- "traefik.http.routers.${GOTIFY_HOST_NAME}-rtr.middlewares=chain-authelia@file" + traefik.http.routers.joplinserver-rtr.middlewares: chain-no-auth@file + ## HTTP Services + traefik.http.routers.joplin-server-rtr.service: joplin-server-svc + traefik.http.services.joplin-server-svc.loadbalancer.server.port: 22300 +# one: +# label_file: ./app.labels +# +# two: +# label_file: +# - ./app.labels +# - ./additional.labels +services: + crowdsec: + image: ${CROWDSEC_IMAGE}:${CROWDSEC_VERSION} + container_name: ${CROWDSEC_CONTAINER_NAME} + restart: ${CROWDSEC_RESTART_POLICY} + security_opt: + - no-new-privileges:true + networks: + - proxy + environment: + GID: "${GID-1000}" + env_file: + - path: ./crowdsec.env + volumes: + - /etc/localtime:/etc/localtime:ro + - ${DOCKERDIR}/crowdsec/acquis.d:/etc/crowdsec/acquis.d + #- ${DOCKERDIR}/crowdsec/acquis.yaml:/etc/crowdsec/acquis.yaml + - ${DOCKERDIR}/crowdsec/db:/var/lib/crowdsec/data/ + - ${DOCKERDIR}/crowdsec/config:/etc/crowdsec/ + - ${DOCKERDIR}/traefik/logs:/var/log/traefik/:ro + - /var/log/auth.log:/logs/auth.log:ro + - /var/log/syslog.log:/logs/syslog.log:ro + +##### Joplin Server Container +JOPLIN_CONTAINER_NAME=traefik +JOPLIN_IMAGE=traefik +JOPLIN_TAG=latest +JOPLIN_RESTART_POLICY=unless-stopped + +##### Joplin Server DB Container +JOPLINDB_CONTAINER_NAME=socket-proxy +JOPLINDB_IMAGE=ghcr.io/tecnativa/docker-socket-proxy +JOPLINDB_TAG=latest +JOPLINDB_RESTART_POLICY=always