Update hostname to *.docker.localhost

Following updates in https://github.com/opdavies/traefik-development to
add HTTPS support to Docker Compose-based projects, this commit changes
the host name from `*.localhost` to `*.docker.localhost`.

This should allow each project to be available at
https://{project_name}.docker.localhost instead of
http://{project_name}.localhost.
This commit is contained in:
Oliver Davies 2024-05-10 23:05:38 +02:00
parent 43849524a2
commit abf76c50bb
6 changed files with 28 additions and 16 deletions

View file

@ -5,13 +5,15 @@ x-proxy: &default-proxy
- default
- web
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_proxy"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(
`${COMPOSE_PROJECT_NAME}.localhost`,
`${COMPOSE_PROJECT_NAME}.docker.localhost`,
{% for host in web.extra_hosts | default([]) -%}
{{ '`' ~ host ~ '`,' }}
{%- endfor %}
)"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.tls=true"
x-app: &default-app
volumes:
@ -27,7 +29,7 @@ x-app: &default-app
cpus: "${DOCKER_MYSQL_CPUS:-0}"
memory: "${DOCKER_MYSQL_MEMORY:-0}"
labels:
- "traefik.enabled=false"
- "traefik.enable=false"
tty: true
services:

View file

@ -5,13 +5,15 @@ x-proxy: &default-proxy
- default
- web
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_proxy"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(
`${COMPOSE_PROJECT_NAME}.localhost`,
`${COMPOSE_PROJECT_NAME}.docker.localhost`,
{% for host in web.extra_hosts | default([]) -%}
{{ '`' ~ host ~ '`,' }}
{%- endfor %}
)"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.tls=true"
x-app: &default-app
volumes:
@ -27,7 +29,7 @@ x-app: &default-app
cpus: "${DOCKER_MYSQL_CPUS:-0}"
memory: "${DOCKER_MYSQL_MEMORY:-0}"
labels:
- "traefik.enabled=false"
- "traefik.enable=false"
tty: true
services:
@ -74,7 +76,7 @@ services:
env_file:
- .env
labels:
- "traefik.enabled=false"
- "traefik.enable=false"
environment:
MYSQL_RANDOM_ROOT_PASSWORD: true
profiles: [database]

View file

@ -5,10 +5,12 @@ x-proxy: &default-proxy
- default
- web
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_proxy"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(
`${COMPOSE_PROJECT_NAME}.localhost`,
`${COMPOSE_PROJECT_NAME}.docker.localhost`,
)"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.tls=true"
x-app: &default-app
volumes:
@ -24,7 +26,7 @@ x-app: &default-app
cpus: "${DOCKER_MYSQL_CPUS:-0}"
memory: "${DOCKER_MYSQL_MEMORY:-0}"
labels:
- "traefik.enabled=false"
- "traefik.enable=false"
tty: true
services:
@ -63,7 +65,7 @@ services:
env_file:
- .env
labels:
- "traefik.enabled=false"
- "traefik.enable=false"
environment:
MYSQL_RANDOM_ROOT_PASSWORD: true
profiles: [database]

View file

@ -5,10 +5,12 @@ x-proxy: &default-proxy
- default
- web
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_proxy"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(
`${COMPOSE_PROJECT_NAME}.localhost`,
`${COMPOSE_PROJECT_NAME}.docker.localhost`,
)"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.tls=true"
x-app: &default-app
volumes:
@ -24,7 +26,7 @@ x-app: &default-app
cpus: "${DOCKER_MYSQL_CPUS:-0}"
memory: "${DOCKER_MYSQL_MEMORY:-0}"
labels:
- "traefik.enabled=false"
- "traefik.enable=false"
tty: true
services:
@ -63,7 +65,7 @@ services:
env_file:
- .env
labels:
- "traefik.enabled=false"
- "traefik.enable=false"
environment:
MYSQL_RANDOM_ROOT_PASSWORD: true
profiles: [database]

View file

@ -5,10 +5,12 @@ x-proxy: &default-proxy
- default
- web
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_proxy"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(
`${COMPOSE_PROJECT_NAME}.localhost`,
`${COMPOSE_PROJECT_NAME}.docker.localhost`,
)"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.tls=true"
x-app: &default-app
volumes:
@ -24,7 +26,7 @@ x-app: &default-app
cpus: "${DOCKER_MYSQL_CPUS:-0}"
memory: "${DOCKER_MYSQL_MEMORY:-0}"
labels:
- "traefik.enabled=false"
- "traefik.enable=false"
tty: true
services:
@ -63,7 +65,7 @@ services:
env_file:
- .env
labels:
- "traefik.enabled=false"
- "traefik.enable=false"
environment:
MYSQL_RANDOM_ROOT_PASSWORD: true
profiles: [database]

View file

@ -5,10 +5,12 @@ x-proxy: &default-proxy
- default
- web
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_proxy"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(
`${COMPOSE_PROJECT_NAME}.localhost`,
`${COMPOSE_PROJECT_NAME}.docker.localhost`,
)"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.tls=true"
x-app: &default-app
volumes:
@ -24,7 +26,7 @@ x-app: &default-app
cpus: "${DOCKER_MYSQL_CPUS:-0}"
memory: "${DOCKER_MYSQL_MEMORY:-0}"
labels:
- "traefik.enabled=false"
- "traefik.enable=false"
tty: true
services: