In this note I’ll document my homelab setup on one cloud VPS with docker-compose. I’m finally happy with the result.
For my homelab I use:
The full docker-compose collection is available in the repo: https://git.ksar.dev/bikulov/ksar
I’d like to outline some features:
.env files, example for each service providedWhere needed, services are configured to support SSO and to connect to gitea as an SSO provider.
All services use SSO for login. But it is not configured initially. So deploy order is important:
glance to monitor all services and start itBelow are some details about chosen settings.
restart: unless-stopped - all containers restart after a Docker daemon reload (if they are not stopped manually).
I prefer storing data in folders:
volumes:
- ./data/gitea:/data
--api.insecure=false – disable the insecure API and dashboard: necessary for production--providers.docker=true – configure Traefik for Docker--providers.docker.exposedbydefault=false – do not add all containers to traefik, only those explicitly marked with traefik.enable=true--providers.docker.network=proxy – what network to use in Docker to choose the IP for the serviceThese three lines are for HTTP -> HTTPS redirect:
--entryPoints.web.address=:80--entryPoints.web.http.redirections.entryPoint.to=websecure--entryPoints.web.http.redirections.entryPoint.scheme=httpsSettings for automatic Let’s Encrypt:
--entryPoints.websecure.address=:443--certificatesresolvers.le.acme.tlschallenge=true--certificatesresolvers.le.acme.email=${TRAEFIK_MAIL}--certificatesresolvers.le.acme.storage=/letsencrypt/acme.jsonAnd the only labels needed for containers are:
traefik.enable=truetraefik.http.services.<CONTAINER_NAME>.loadbalancer.server.port=<APP_PORT>traefik.http.routers.<CONTAINER_NAME>.rule=Host(${SERVER_HOST})traefik.http.routers.<CONTAINER_NAME>.entrypoints=websecuretraefik.http.routers.<CONTAINER_NAME>.tls.certresolver=leHappy homelabbing!