In this note I’ll document my homelab setup on one cloud VPS with docker-compose. I’m finally happy with the result.
For homelab I use:
The full docker-compose collection is available in 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 be connected to gitea as SSO provider.
Below are some details about chosen settings.
restart: unless-stopped - all containers restarted after Docker daemon reload (if they are not stopped manually).
I use folders to store data:
volumes:
- ./data/gitea:/data
--api.insecure=false – disable the insecure API and dashboard: necessary for prod--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 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 letsencrypt:
--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=leThere is some dependencies: all services use SSO for login. But at first time it is not configured. So:
glance to monitor all services and start itHappy homelabing!