Compare commits
2 commits
1758d5a85c
...
f8c43f9709
Author | SHA1 | Date | |
---|---|---|---|
f8c43f9709 | |||
ba9a865b55 |
6 changed files with 19 additions and 76 deletions
2
config
2
config
|
@ -1 +1 @@
|
|||
Subproject commit a36055337246e8ddd83811c982769fab1d555748
|
||||
Subproject commit 40b13ab1b1b52d617851f56d89c4017e0360c3b3
|
|
@ -31,6 +31,8 @@ type traefikConfig struct {
|
|||
SharedMountPoint string `json:"sharedMountPoint"`
|
||||
TlsHostDirectory string `json:"tlsHostDirectory"`
|
||||
TlsContainerDirectory string `json:"tlsContainerDirectory"`
|
||||
StaticConfigDirectory string `json:"staticConfigDirectory"`
|
||||
DynamicConfigDirectory string `json:"dynamicConfigDirectory"`
|
||||
}
|
||||
|
||||
type forgejoConfig struct {
|
||||
|
|
|
@ -19,10 +19,6 @@ networks:
|
|||
config:
|
||||
- subnet: "{{ .DockerNetworkSubnet }}"
|
||||
|
||||
volumes:
|
||||
traefik-shared:
|
||||
name: "traefik-config-shared-volume"
|
||||
|
||||
services:
|
||||
# -- Traffic flow --
|
||||
traefik:
|
||||
|
@ -49,10 +45,6 @@ services:
|
|||
restart: "always"
|
||||
volumes:
|
||||
{{- template "defaultVolumes" }}
|
||||
# Shared volume
|
||||
- type: "volume"
|
||||
source: "traefik-shared"
|
||||
target: "{{ .Traefik.SharedMountPoint }}"
|
||||
# Traefik TLS volume
|
||||
- type: "bind"
|
||||
source: "{{ .Traefik.TlsHostDirectory }}"
|
||||
|
@ -72,10 +64,6 @@ services:
|
|||
restart: "always"
|
||||
volumes:
|
||||
{{- template "defaultVolumes" }}
|
||||
# Shared volume
|
||||
- type: "volume"
|
||||
source: "traefik-shared"
|
||||
target: "{{ .Traefik.SharedMountPoint }}"
|
||||
# Forgejo data volume
|
||||
- type: "bind"
|
||||
source: "{{ .Forgejo.DataHostDirectory }}"
|
||||
|
@ -96,10 +84,6 @@ services:
|
|||
restart: "always"
|
||||
volumes:
|
||||
{{- template "defaultVolumes" }}
|
||||
# Shared volume
|
||||
- type: "volume"
|
||||
source: "traefik-shared"
|
||||
target: "{{ .Traefik.SharedMountPoint }}"
|
||||
# Go To Social data volume
|
||||
- type: "bind"
|
||||
source: "{{ .GoToSocial.DataHostDirectory }}"
|
||||
|
@ -135,10 +119,6 @@ services:
|
|||
restart: "always"
|
||||
volumes:
|
||||
{{- template "defaultVolumes" }}
|
||||
# Shared volume
|
||||
- type: "volume"
|
||||
source: "traefik-shared"
|
||||
target: "{{ .Traefik.SharedMountPoint }}"
|
||||
# Woodpecker data volume
|
||||
- type: "bind"
|
||||
source: "{{ .Woodpecker.DataHostDirectory }}"
|
||||
|
|
|
@ -1,18 +1,9 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
FROM traefik:{{ .Traefik.Version }}
|
||||
|
||||
ADD traefik.yaml /flow/traefik/
|
||||
RUN --mount=type=bind,source=.,target=/packages \
|
||||
mkdir -p {{ .Traefik.StaticConfigDirectory }} {{ .Traefik.DynamicConfigDirectory }} \
|
||||
&& cp /packages/traefik.yaml {{ .Traefik.StaticConfigDirectory }}/traefik.yaml \
|
||||
&& cp /packages/dynamic_*.yaml {{ .Traefik.DynamicConfigDirectory }}/
|
||||
|
||||
ADD dynamic_landing_page.yaml /tmp/dynamic_landing_page.yaml
|
||||
|
||||
ADD dynamic_gotosocial.yaml /tmp/dynamic_gotosocial.yaml
|
||||
|
||||
ADD dynamic_woodpecker.yaml /tmp/dynamic_woodpecker.yaml
|
||||
|
||||
ADD dynamic_forgejo.yaml /tmp/dynamic_forgejo.yaml
|
||||
|
||||
ADD entrypoint.sh /
|
||||
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
CMD ["--configfile=/flow/traefik/traefik.yaml"]
|
||||
CMD ["--configfile={{ .Traefik.StaticConfigDirectory }}/traefik.yaml"]
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# Create the dynamic config directory in the shared volume.
|
||||
mkdir -p {{ .Traefik.SharedMountPoint }}/dynamic
|
||||
chgrp {{ .FlowGID }} {{ .Traefik.SharedMountPoint }}/dynamic
|
||||
chmod a-rwx,u+rwx,g+rwx {{ .Traefik.SharedMountPoint }}/dynamic
|
||||
|
||||
# Move any dynamic config to the new directory.
|
||||
for f in $( find /tmp -mindepth 1 -maxdepth 1 -type f -iname 'dynamic*.yaml' -exec basename {} \; ); do
|
||||
echo "INFO: Moving /tmp/${f} to {{ .Traefik.SharedMountPoint }}/dynamic/${f}..."
|
||||
mv -f /tmp/${f} {{ .Traefik.SharedMountPoint }}/dynamic/${f}
|
||||
done
|
||||
|
||||
# first arg is `-f` or `--some-option`
|
||||
if [ "${1#-}" != "$1" ]; then
|
||||
set -- traefik "$@"
|
||||
fi
|
||||
|
||||
# if our command is a valid Traefik subcommand, let's invoke it through Traefik instead
|
||||
# (this allows for "docker run traefik version", etc)
|
||||
if traefik "$1" --help >/dev/null 2>&1
|
||||
then
|
||||
set -- traefik "$@"
|
||||
else
|
||||
echo "= '$1' is not a Traefik command: assuming shell execution." 1>&2
|
||||
fi
|
||||
|
||||
exec "$@"
|
|
@ -22,7 +22,7 @@ entryPoints:
|
|||
providers:
|
||||
file:
|
||||
watch: true
|
||||
directory: "{{ .Traefik.SharedMountPoint }}/dynamic"
|
||||
directory: "{{ .Traefik.DynamicConfigDirectory }}"
|
||||
certificatesResolvers:
|
||||
resolver:
|
||||
acme:
|
||||
|
|
Loading…
Reference in a new issue