Move to Traefik
This commit is contained in:
parent
bf57c0d5a6
commit
471ccbadc5
36 changed files with 200 additions and 190 deletions
|
|
@ -1,10 +1,9 @@
|
|||
DATA_PATH=${DATA_PATH}
|
||||
RUNTIME_DIR=${RUNTIME_DIR}
|
||||
GLOBAL_AUTHORIZED_KEYS_FILE=${GLOBAL_AUTHORIZED_KEYS_FILE}
|
||||
|
||||
SLUG=${SLUG}
|
||||
VIRTUAL_HOST=${VIRTUAL_HOST}
|
||||
DOCKER_NETWORK_NAME=${DOCKER_NETWORK_NAME}
|
||||
|
||||
LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
|
||||
LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
|
||||
|
||||
GLOBAL_AUTHORIZED_KEYS_FILE=${GLOBAL_AUTHORIZED_KEYS_FILE}
|
||||
HTTPS_ENABLED=${HTTPS_ENABLED}
|
||||
|
|
@ -5,19 +5,19 @@ services:
|
|||
build: .
|
||||
restart: always
|
||||
hostname: ${VIRTUAL_HOST}.wisski
|
||||
environment:
|
||||
# port and hostname for this image to use
|
||||
VIRTUAL_HOST: ${VIRTUAL_HOST}
|
||||
VIRTUAL_PORT: 8080
|
||||
|
||||
# optional letsencrypt email
|
||||
LETSENCRYPT_HOST: ${LETSENCRYPT_HOST}
|
||||
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
||||
|
||||
|
||||
# label it with the current slug
|
||||
labels:
|
||||
eu.wiss-ki.barrel.slug: ${SLUG}
|
||||
eu.wiss-ki.barrel.authfile: /var/www/.ssh/authorized_keys,/var/www/.ssh/global_authorized_keys
|
||||
- "eu.wiss-ki.barrel.slug=${SLUG}"
|
||||
- "eu.wiss-ki.barrel.authfile:=/var/www/.ssh/authorized_keys,/var/www/.ssh/global_authorized_keys"
|
||||
|
||||
- "traefik.enable=True"
|
||||
- "eu.wiss-ki.barrel.distillery=${DOCKER_NETWORK_NAME}"
|
||||
|
||||
- "traefik.http.routers.wisski_${SLUG}.rule=Host(`${VIRTUAL_HOST}`)"
|
||||
- "traefik.http.routers.wisski_${SLUG}.tls=${HTTPS_ENABLED}"
|
||||
- "traefik.http.routers.wisski_${SLUG}.tls.certresolver=distillery"
|
||||
- "traefik.http.services.wisski_${SLUG}.loadbalancer.server.port=8080"
|
||||
|
||||
# volumes that are mounted
|
||||
volumes:
|
||||
|
|
@ -29,5 +29,5 @@ services:
|
|||
|
||||
networks:
|
||||
default:
|
||||
name: distillery
|
||||
name: ${DOCKER_NETWORK_NAME}
|
||||
external: true
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
SLUG=${SLUG}
|
||||
VIRTUAL_HOST=${VIRTUAL_HOST}
|
||||
|
||||
LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
|
||||
LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
|
||||
DOCKER_NETWORK_NAME=${DOCKER_NETWORK_NAME}
|
||||
HTTPS_ENABLED=${HTTPS_ENABLED}
|
||||
|
|
|
|||
|
|
@ -4,23 +4,24 @@ services:
|
|||
static:
|
||||
image: tkw01536/gostatic
|
||||
restart: always
|
||||
environment:
|
||||
# port and hostname for this image to use
|
||||
VIRTUAL_HOST: ${VIRTUAL_HOST}
|
||||
VIRTUAL_PORT: 8043
|
||||
|
||||
# optional letsencrypt email
|
||||
LETSENCRYPT_HOST: ${LETSENCRYPT_HOST}
|
||||
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
||||
|
||||
ports:
|
||||
- 8043
|
||||
|
||||
labels:
|
||||
- "traefik.enable=True"
|
||||
- "eu.wiss-ki.barrel.distillery=${DOCKER_NETWORK_NAME}"
|
||||
|
||||
- "traefik.http.routers.reserve_${SLUG}.rule=Host(`${VIRTUAL_HOST}`)"
|
||||
- "traefik.http.routers.reserve_${SLUG}.tls=${HTTPS_ENABLED}"
|
||||
- "traefik.http.routers.reserve_${SLUG}.tls.certresolver=distillery"
|
||||
- "traefik.http.services.reserve_${SLUG}.loadbalancer.server.port=8043"
|
||||
|
||||
|
||||
# volumes that are mounted
|
||||
volumes:
|
||||
- ./index.html:/srv/http/index.html:ro
|
||||
|
||||
networks:
|
||||
default:
|
||||
name: distillery
|
||||
name: ${DOCKER_NETWORK_NAME}
|
||||
external: true
|
||||
|
|
|
|||
|
|
@ -25,14 +25,13 @@ func (wisski *WissKI) Barrel() component.StackWithResources {
|
|||
EnvPath: filepath.Join("instances", "barrel.env"),
|
||||
|
||||
EnvContext: map[string]string{
|
||||
"DATA_PATH": filepath.Join(wisski.FilesystemBase, "data"),
|
||||
"DOCKER_NETWORK_NAME": wisski.instances.Config.DockerNetworkName,
|
||||
|
||||
"SLUG": wisski.Slug,
|
||||
"VIRTUAL_HOST": wisski.Domain(),
|
||||
|
||||
"LETSENCRYPT_HOST": wisski.instances.Config.IfHttps(wisski.Domain()),
|
||||
"LETSENCRYPT_EMAIL": wisski.instances.Config.IfHttps(wisski.instances.Config.CertbotEmail),
|
||||
"SLUG": wisski.Slug,
|
||||
"VIRTUAL_HOST": wisski.Domain(),
|
||||
"HTTPS_ENABLED": wisski.instances.Config.HTTPSEnabledEnv(),
|
||||
|
||||
"DATA_PATH": filepath.Join(wisski.FilesystemBase, "data"),
|
||||
"RUNTIME_DIR": wisski.instances.Config.RuntimeDir(),
|
||||
"GLOBAL_AUTHORIZED_KEYS_FILE": wisski.instances.Config.GlobalAuthorizedKeysFile,
|
||||
},
|
||||
|
|
@ -109,10 +108,11 @@ func (wisski *WissKI) Reserve() component.StackWithResources {
|
|||
EnvPath: filepath.Join("instances", "reserve.env"),
|
||||
|
||||
EnvContext: map[string]string{
|
||||
"VIRTUAL_HOST": wisski.Domain(),
|
||||
"DOCKER_NETWORK_NAME": wisski.instances.Config.DockerNetworkName,
|
||||
|
||||
"LETSENCRYPT_HOST": wisski.instances.Config.IfHttps(wisski.Domain()),
|
||||
"LETSENCRYPT_EMAIL": wisski.instances.Config.IfHttps(wisski.instances.Config.CertbotEmail),
|
||||
"SLUG": wisski.Slug,
|
||||
"VIRTUAL_HOST": wisski.Domain(),
|
||||
"HTTPS_ENABLED": wisski.instances.Config.HTTPSEnabledEnv(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue