{"id":30503665,"url":"https://github.com/thomasborgen/traefik-docker-compose","last_synced_at":"2026-02-12T15:32:31.326Z","repository":{"id":311506575,"uuid":"1043888958","full_name":"thomasborgen/traefik-docker-compose","owner":"thomasborgen","description":"Docker compose file for running Traefik in a docker container that can autoregister other containers running from the same host.","archived":false,"fork":false,"pushed_at":"2025-08-24T21:37:53.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-25T00:42:24.580Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomasborgen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-24T20:38:14.000Z","updated_at":"2025-08-24T21:37:56.000Z","dependencies_parsed_at":"2025-08-25T00:42:27.362Z","dependency_job_id":"16f60cd5-451b-4c54-96e9-7176810c54b0","html_url":"https://github.com/thomasborgen/traefik-docker-compose","commit_stats":null,"previous_names":["thomasborgen/traefik-docker-compose"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/thomasborgen/traefik-docker-compose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasborgen%2Ftraefik-docker-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasborgen%2Ftraefik-docker-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasborgen%2Ftraefik-docker-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasborgen%2Ftraefik-docker-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomasborgen","download_url":"https://codeload.github.com/thomasborgen/traefik-docker-compose/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasborgen%2Ftraefik-docker-compose/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272077541,"owners_count":24869282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-25T13:39:16.983Z","updated_at":"2026-02-12T15:32:31.307Z","avatar_url":"https://github.com/thomasborgen.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deprecated\n\nNot going to do any more work here, but will polish [server services](https://github.com/thomasborgen/server-services) instead\n\n\u003e Server services contains adminer and backweb so that you can use one instance of adminer to look at databases runnin on the server and using one backweb instance to backup services.\n\n# Traefik in a docker compose\n\n\u003e This is just a file for me to have a traefik docker compose file that i can copy to my server\n\u003e and run docker compose up -d and then have other docker containers register their subdomains to \n\u003e it.\n\nYou need to set the env variables shown in the .env.example either by making an `.env` file, exportin variables before running\n`docker compose up -d` or just add them in the `docker` command.\n\nwhen running locally just add the `.env` file, update it and run `docker compose -f docker-compose.local.yml up -d`\n\n\n## Traefik Deployed on your server\n\n### On the server:\n\n* Create a directory to store your Traefik Docker Compose file:\n\n```bash\nmkdir -p /root/code/traefik-public/\n```\n\n* Create a docker network that other docker containers will use if they need to be accessed from the outside\n\n```bash\ndocker network create traefik-public\n```\n\n### Locally\n\n* Copy the Traefik Docker Compose file to your server. You could do it by running the command `rsync` in your local terminal:\n\n```bash\nrsync -a docker-compose.yml root@your-server.example.com:/root/code/traefik-public/\n```\n\n* Copy the env.example file now or you could also edit it locally first if you want.\n\n```bash\ncp .env.example .env\n```\n\n* Edit vars\n\n* Use openssl to generate the \"hashed\" version of the password for HTTP Basic Auth:\n\n```bash\nopenssl passwd -apr1 this-will-be-your-admin-password\n```\n\n\u003e edit the .env file with the new password that looks something like: `$apr1$/gcaYTx8$DWaJxuRnx5gU/Y53C3nc8/`\n\n* Change the domain name to your domain name\n\n```bash\nDOMAIN=example.com\n```\n\n* Create an environment variable with the email for Let's Encrypt, e.g.:\n\n```bash\nexport EMAIL=admin@example.com\n```\n\n**Note**: you need to set a different email, an email `@example.com` won't work.\n\n\n* Copy the edited .env file to the server by running the command `rsync` in your local terminal:\n\n```bash\nrsync -a .env root@your-server.example.com:/root/code/traefik-public/\n```\n\n### On the server\n\n### Start the Traefik Docker Compose\n\nGo to the directory where you copied the Traefik Docker Compose file in your remote server:\n\n```bash\ncd /root/code/traefik-public/\n```\n\nNow with the environment variables set and the `docker-compose.yml` in place, you can start the Traefik Docker Compose running the following command:\n\n```bash\ndocker compose up -d\n```\n\n\nTo register a service with this traefik instance add the following to your services docker compose file:\n\nThis requires the env variables DOMAIN and STACK_NAME to be present.\n\nusing env_file: required: false, is convenient for local development so you can just have the vars in a file.\n\nFor deploying, add them to your github action secrets or whatever you use to deploy.\n\n```yml\nnetworks:\n  traefik-public:\n    # Allow setting it to false for testing\n    external: true\n\nservices:\n\n  # My service has no subdomain and registeres to traefik directly to DOMAIN ie test.com\n  my-service:\n    networks:\n      - traefik-public\n      - default\n    env_file:\n      - path: .env\n        required: false\n    labels:\n      - traefik.enable=true\n      - traefik.docker.network=traefik-public\n      - traefik.constraint-label=traefik-public\n\n      - traefik.http.services.${STACK_NAME?Variable not set}.loadbalancer.server.port=8000\n\n      - traefik.http.routers.${STACK_NAME?Variable not set}-http.rule=Host(`${DOMAIN?Variable not set}`)\n      - traefik.http.routers.${STACK_NAME?Variable not set}-http.entrypoints=http\n\n      - traefik.http.routers.${STACK_NAME?Variable not set}-https.rule=Host(`${DOMAIN?Variable not set}`)\n      - traefik.http.routers.${STACK_NAME?Variable not set}-https.entrypoints=https\n      - traefik.http.routers.${STACK_NAME?Variable not set}-https.tls=true\n      - traefik.http.routers.${STACK_NAME?Variable not set}-https.tls.certresolver=le\n\n      # Enable redirection for HTTP and HTTPS\n      - traefik.http.routers.${STACK_NAME?Variable not set}-http.middlewares=https-redirect\n\n  # Adminer has a subdomain \"adminer\". It registeres to adminer.DOMAIN ie: adminer.test.com\n  adminer:\n    image: adminer\n    restart: always\n    networks:\n      - traefik-public\n      - default\n    # depends_on:\n    #   - db\n    environment:\n      - ADMINER_DESIGN=pepa-linha-dark\n    labels:\n      - traefik.enable=true\n      - traefik.docker.network=traefik-public\n      - traefik.constraint-label=traefik-public\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-http.rule=Host(`adminer.${DOMAIN?Variable not set}`)\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-http.entrypoints=http\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-http.middlewares=https-redirect\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.rule=Host(`adminer.${DOMAIN?Variable not set}`)\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.entrypoints=https\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.tls=true\n      - traefik.http.routers.${STACK_NAME?Variable not set}-adminer-https.tls.certresolver=le\n      - traefik.http.services.${STACK_NAME?Variable not set}-adminer.loadbalancer.server.port=8080\n\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasborgen%2Ftraefik-docker-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomasborgen%2Ftraefik-docker-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasborgen%2Ftraefik-docker-compose/lists"}