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
|
|
@ -21,16 +21,18 @@ type config struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type traefikConfig struct {
|
type traefikConfig struct {
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
CheckNewVersion bool `json:"checkNewVersion"`
|
CheckNewVersion bool `json:"checkNewVersion"`
|
||||||
ExternalSSHPort int32 `json:"externalSSHPort"`
|
ExternalSSHPort int32 `json:"externalSSHPort"`
|
||||||
LogLevel string `json:"logLevel"`
|
LogLevel string `json:"logLevel"`
|
||||||
SendAnonymousUsage bool `json:"sendAnonymousUsage"`
|
SendAnonymousUsage bool `json:"sendAnonymousUsage"`
|
||||||
ContainerIpv4Address string `json:"containerIpv4Address"`
|
ContainerIpv4Address string `json:"containerIpv4Address"`
|
||||||
AcmeEmail string `json:"acmeEmail"`
|
AcmeEmail string `json:"acmeEmail"`
|
||||||
SharedMountPoint string `json:"sharedMountPoint"`
|
SharedMountPoint string `json:"sharedMountPoint"`
|
||||||
TlsHostDirectory string `json:"tlsHostDirectory"`
|
TlsHostDirectory string `json:"tlsHostDirectory"`
|
||||||
TlsContainerDirectory string `json:"tlsContainerDirectory"`
|
TlsContainerDirectory string `json:"tlsContainerDirectory"`
|
||||||
|
StaticConfigDirectory string `json:"staticConfigDirectory"`
|
||||||
|
DynamicConfigDirectory string `json:"dynamicConfigDirectory"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type forgejoConfig struct {
|
type forgejoConfig struct {
|
||||||
|
|
|
@ -19,10 +19,6 @@ networks:
|
||||||
config:
|
config:
|
||||||
- subnet: "{{ .DockerNetworkSubnet }}"
|
- subnet: "{{ .DockerNetworkSubnet }}"
|
||||||
|
|
||||||
volumes:
|
|
||||||
traefik-shared:
|
|
||||||
name: "traefik-config-shared-volume"
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# -- Traffic flow --
|
# -- Traffic flow --
|
||||||
traefik:
|
traefik:
|
||||||
|
@ -49,10 +45,6 @@ services:
|
||||||
restart: "always"
|
restart: "always"
|
||||||
volumes:
|
volumes:
|
||||||
{{- template "defaultVolumes" }}
|
{{- template "defaultVolumes" }}
|
||||||
# Shared volume
|
|
||||||
- type: "volume"
|
|
||||||
source: "traefik-shared"
|
|
||||||
target: "{{ .Traefik.SharedMountPoint }}"
|
|
||||||
# Traefik TLS volume
|
# Traefik TLS volume
|
||||||
- type: "bind"
|
- type: "bind"
|
||||||
source: "{{ .Traefik.TlsHostDirectory }}"
|
source: "{{ .Traefik.TlsHostDirectory }}"
|
||||||
|
@ -72,10 +64,6 @@ services:
|
||||||
restart: "always"
|
restart: "always"
|
||||||
volumes:
|
volumes:
|
||||||
{{- template "defaultVolumes" }}
|
{{- template "defaultVolumes" }}
|
||||||
# Shared volume
|
|
||||||
- type: "volume"
|
|
||||||
source: "traefik-shared"
|
|
||||||
target: "{{ .Traefik.SharedMountPoint }}"
|
|
||||||
# Forgejo data volume
|
# Forgejo data volume
|
||||||
- type: "bind"
|
- type: "bind"
|
||||||
source: "{{ .Forgejo.DataHostDirectory }}"
|
source: "{{ .Forgejo.DataHostDirectory }}"
|
||||||
|
@ -96,10 +84,6 @@ services:
|
||||||
restart: "always"
|
restart: "always"
|
||||||
volumes:
|
volumes:
|
||||||
{{- template "defaultVolumes" }}
|
{{- template "defaultVolumes" }}
|
||||||
# Shared volume
|
|
||||||
- type: "volume"
|
|
||||||
source: "traefik-shared"
|
|
||||||
target: "{{ .Traefik.SharedMountPoint }}"
|
|
||||||
# Go To Social data volume
|
# Go To Social data volume
|
||||||
- type: "bind"
|
- type: "bind"
|
||||||
source: "{{ .GoToSocial.DataHostDirectory }}"
|
source: "{{ .GoToSocial.DataHostDirectory }}"
|
||||||
|
@ -135,10 +119,6 @@ services:
|
||||||
restart: "always"
|
restart: "always"
|
||||||
volumes:
|
volumes:
|
||||||
{{- template "defaultVolumes" }}
|
{{- template "defaultVolumes" }}
|
||||||
# Shared volume
|
|
||||||
- type: "volume"
|
|
||||||
source: "traefik-shared"
|
|
||||||
target: "{{ .Traefik.SharedMountPoint }}"
|
|
||||||
# Woodpecker data volume
|
# Woodpecker data volume
|
||||||
- type: "bind"
|
- type: "bind"
|
||||||
source: "{{ .Woodpecker.DataHostDirectory }}"
|
source: "{{ .Woodpecker.DataHostDirectory }}"
|
||||||
|
|
|
@ -1,18 +1,9 @@
|
||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
FROM traefik:{{ .Traefik.Version }}
|
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
|
CMD ["--configfile={{ .Traefik.StaticConfigDirectory }}/traefik.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"]
|
|
||||||
|
|
|
@ -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:
|
providers:
|
||||||
file:
|
file:
|
||||||
watch: true
|
watch: true
|
||||||
directory: "{{ .Traefik.SharedMountPoint }}/dynamic"
|
directory: "{{ .Traefik.DynamicConfigDirectory }}"
|
||||||
certificatesResolvers:
|
certificatesResolvers:
|
||||||
resolver:
|
resolver:
|
||||||
acme:
|
acme:
|
||||||
|
|
Loading…
Reference in a new issue