Premier commit

This commit is contained in:
“Albert
2023-01-05 11:44:26 +01:00
parent d46e9954ca
commit fb19dc24e5
554 changed files with 46045 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
http:
routers:
traefik:
rule: "Host(`traefik.docker.localhost`)"
service: "api@internal"
tls:
domains:
- main: "docker.localhost"
sans:
- "*.docker.localhost"
- main: "s-nxc.gsb.lan"
sans:
- "*.gsb.lan"
tls:
certificates:
- certFile: "/etc/certs/local-cert.pem"
keyFile: "/etc/certs/local-key.pem"

View File

@@ -0,0 +1,58 @@
version: '2'
volumes:
# nextcloud:
db:
services:
db:
image: mariadb
container_name: db
restart: always
#command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
command: --innodb-read-only-compressed=OFF
volumes:
- db:/var/lib/mysql
networks:
- nxc-db
environment:
- MYSQL_ROOT_PASSWORD=blabla
- MYSQL_PASSWORD=blabla
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
nxc:
image: nextcloud
restart: always
container_name: nxc
# ports:
# - 8080:80
# links:
depends_on:
- db
volumes:
- ./nextcloud:/var/www/html
environment:
- MYSQL_PASSWORD=blabla
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
labels:
# Enable this container to be mapped by traefik
# For more information, see: https://docs.traefik.io/providers/docker/#exposedbydefault
- "traefik.enable=true"
# URL to reach this container
- "traefik.http.routers.nxc.rule=Host(`s-nxc.gsb.lan`)"
# Activation of TLS
- "traefik.http.routers.nxc.tls=true"
# If port is different than 80, use the following service:
#- "traefik.http.services.<service_name>.loadbalancer.server.port=<port>"
# - "traefik.http.services.app.loadbalancer.server.port=8080"
networks:
- proxy
- nxc-db
networks:
proxy:
external: true
nxc-db:
external: false

View File

@@ -0,0 +1,6 @@
#!/bin/bash
docker-compose -f nextcloud.yml down
docker-compose -f traefik.yml down
sleep 1
docker-compose -f traefik.yml up -d --remove-orphans
docker-compose -f nextcloud.yml up -d

View File

@@ -0,0 +1,4 @@
#!/bin/bash
docker volume prune -f
docker container prune -f
docker image prune -f

View File

@@ -0,0 +1,3 @@
#!/bin/bash
docker-compose -f traefik.yml up -d
docker-compose -f nextcloud.yml up -d

View File

@@ -0,0 +1,3 @@
#!/bin/bash
docker-compose -f nextcloud.yml down
docker-compose -f traefik.yml down

View File

@@ -0,0 +1,31 @@
global:
sendAnonymousUsage: false
api:
dashboard: true
insecure: true
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
watch: true
exposedByDefault: false
file:
filename: /etc/traefik/dynamic.yml
watch: true
log:
level: INFO
format: common
entryPoints:
http:
address: ":80"
http:
redirections:
entryPoint:
to: https
scheme: https
https:
address: ":443"

View File

@@ -0,0 +1,28 @@
version: '3'
services:
reverse-proxy:
#image: traefik:v2.5
image: traefik
container_name: traefik
restart: always
security_opt:
- no-new-privileges:true
ports:
# Web
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
# Map the static configuration into the container
- ./config/static.yml:/etc/traefik/traefik.yml:ro
# Map the dynamic configuration into the container
- ./config/dynamic.yml:/etc/traefik/dynamic.yml:ro
# Map the certificats into the container
- ./certs:/etc/certs:ro
networks:
- proxy
networks:
proxy:
external: true