2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-09-16 17:19:03 +00:00
frappe_docker/overrides/compose.traefik.yaml
Yeifer Alexander Muñoz Torres fa543662ed
#1402 Environment variables for custom image (#1403)
* chore: enhance compose.yaml with variables for customize

* chore: use default blank values for db and redis variables in compose.yaml

* chore: Use env var for HTTP(S) publish ports in overrides

* docs: explain use of environment variables for image customization

* chore: use ERPNEXT_VERSION as default

* docs: fixed spelling errors
2024-06-08 00:21:17 +05:30

48 lines
1.9 KiB
YAML

version: "3.3"
services:
traefik:
image: "traefik:v2.6"
restart: unless-stopped
labels:
# Enable Traefik for this service, to make it available in the public network
- traefik.enable=true
# Use the traefik-public network (declared below)
- traefik.docker.network=traefik-public
# admin-auth middleware with HTTP Basic auth
# Using the environment variables USERNAME and HASHED_PASSWORD
- traefik.http.middlewares.admin-auth.basicauth.users=admin:${HASHED_PASSWORD:?No HASHED_PASSWORD set}
# Uses the environment variable TRAEFIK_DOMAIN
- traefik.http.routers.traefik-public-http.rule=Host(`${TRAEFIK_DOMAIN:?No TRAEFIK_DOMAIN set}`)
- traefik.http.routers.traefik-public-http.entrypoints=http
# Use the special Traefik service api@internal with the web UI/Dashboard
- traefik.http.routers.traefik-public-http.service=api@internal
# Enable HTTP Basic auth, using the middleware created above
- traefik.http.routers.traefik-public-http.middlewares=admin-auth
# Define the port inside of the Docker service to use
- traefik.http.services.traefik-public.loadbalancer.server.port=8080
command:
# Enable Docker in Traefik, so that it reads labels from Docker services
- --providers.docker=true
# Do not expose all Docker services, only the ones explicitly exposed
- --providers.docker.exposedbydefault=false
# Create an entrypoint http listening on port 80
- --entrypoints.http.address=:80
# Enable the access log, with HTTP requests
- --accesslog
# Enable the Traefik log, for configurations and errors
- --log
# Enable the Dashboard and API
- --api
ports:
- ${HTTP_PUBLISH_PORT:-80}:80
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- traefik-public
networks:
traefik-public:
name: traefik-public
external: false