{"id":28464337,"url":"https://github.com/wildcodeschool/vps-traefik-starter-kit","last_synced_at":"2025-06-30T18:33:13.910Z","repository":{"id":172383910,"uuid":"613730331","full_name":"WildCodeSchool/vps-traefik-starter-kit","owner":"WildCodeSchool","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-18T03:45:19.000Z","size":70,"stargazers_count":3,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-07T05:09:29.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/WildCodeSchool.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}},"created_at":"2023-03-14T06:43:10.000Z","updated_at":"2025-03-04T14:03:35.000Z","dependencies_parsed_at":"2023-11-28T17:27:19.675Z","dependency_job_id":"829646bd-fb97-456e-95f7-d2ad20080113","html_url":"https://github.com/WildCodeSchool/vps-traefik-starter-kit","commit_stats":null,"previous_names":["wildcodeschool/vps-traefik-starter-kit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WildCodeSchool/vps-traefik-starter-kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildCodeSchool%2Fvps-traefik-starter-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildCodeSchool%2Fvps-traefik-starter-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildCodeSchool%2Fvps-traefik-starter-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildCodeSchool%2Fvps-traefik-starter-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WildCodeSchool","download_url":"https://codeload.github.com/WildCodeSchool/vps-traefik-starter-kit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildCodeSchool%2Fvps-traefik-starter-kit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262829453,"owners_count":23371086,"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","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-06-07T05:09:29.191Z","updated_at":"2025-06-30T18:33:13.896Z","avatar_url":"https://github.com/WildCodeSchool.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- TOC --\u003e\n\n* [Traefik starter kit for VPS](#traefik-starter-kit-for-vps)\n    * [Prerequisites](#prerequisites)\n    * [Step1 - Configure and start Traefik](#step1---configure-and-start-traefik)\n    * [Step2 - Mount a Mysql database with Phpmyadmin](#step2---mount-a-mysql-database-with-phpmyadmin)\n    * [Deploy your projects](#deploy-your-projects)\n        * [For Simple-MVC \u0026 Symfony starter kits.](#for-simple-mvc--symfony-starter-kits)\n        * [Let's Encrypt SSL certificates explanations](#lets-encrypt-ssl-certificates-explanations)\n    * [Troubleshooting \u0026 useful commands](#troubleshooting--useful-commands)\n\n\u003c!-- TOC --\u003e\n\n# Traefik starter kit for VPS\n\n## Prerequisites\n\nMust be installed on the VPS before anything else\n\n- Docker\n- Docker Compose\n- Git\n- htpasswd utility from apache2-utils\n\nSee [Prerequisites](PREREQUISITES.md) page for more information.\n\n## Step1 - Configure and start Traefik\n\nFirst, clone this repository in a `traefik` directory and `cd` in it.\n\n```bash\ngit clone https://github.com/WildCodeSchool/vps-traefik-starter-kit.git traefik\ncd traefik\n```\n\nThe file `install.sh` is ready to configure and start Traefik automatically.  \nCreate `.env` file from `.env.sample` in `/data` directory, edit values and save.\n\n```bash\ncp ./data/.env.sample ./data/.env\nnano ./data/.env\n```\n\n| Var                     | Description                                                                                                                                                                            |\n|-------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| HOST                    | Your main domain pointing to the VPS. You can write __localhost__ when running Docker in local.                                                                                        |\n| LETS_ENCRYPT_EMAIL      | Used to generate letsencrypt certificate. \u003cbr/\u003e Write a valid email so you will receive renew reminders.                                                                               |\n| USER_NAME               | User login to Traefik dashboard. Will also be used to create a user with all privileges when installing the database. \u003cbr/\u003eCan access to database from external container on port 3306 |\n| USER_PASSWORD           | User password to log in Traefik dashboard. Will be used for main user database too.                                                                                                    |\n| DATABASE_SUBDOMAIN_NAME | Name given to the container and used to create docker volume `database-db`, container `database-db` and subdomain.                                                                     |\n| MYSQL_ROOT_PASSWORD     | Root password needed when connect to mysql from internal service container. \u003cbr/\u003eConnection with root is disabled from external.                                                       |\n| APP_SECRET              | Secret key needed to produce JWT tokens (**only for the JS template**).                                                                                                                |\n\nOnce this is done, simply run the script.\n\n```bash\nbash install.sh\n```\n\nTraefik is then ready to process proxy requests.  \nThe Traefik dashboard is accessible at [https://traefik.your_domain.dev](https://traefik.your_domain.dev) with the\ncredentials you provided (your_domain.dev replaced by your domain).\n\n## Step2 - Mount a Mysql database with Phpmyadmin\n\nIf you have correctly filled in all the fields in the .env file from step 1, just run the following command.\n\n```bash\ndocker compose --env-file ./data/.env -f ./database/docker-compose.yml up -d\n```\n\nWhen done, PhpMyadmin is reachable at something\nlike [https://pma.database.your_domain.dev](https://pma.database.your_domain.dev) where `database` depends on\nthe value of DATABASE_SUBDOMAIN_NAME and `your_domain.dev` on the value of HOST.\nThis database will be persisted thanks to `database-db` volume and reachable from any external container\nwith `database-db` container name.  \nExample:\n\n```dotenv\nDATABASE_URL=\"mysql://user:password@database-db:3306/my_app?serverVersion=8\u0026charset=utf8mb4\"\n```\n\n## Deploy your projects\n\nWarning: ensure your GitHub repository is public, or the deployment process will fail.\n\n### For Simple-MVC \u0026 Symfony starter kits.\n\nThe `php-project.sh` file in the `deploy` directory can be used by Github action to trigger deployment, updates and\nbuild of Docker containers automatically.\nYou just have to add on each git repository three following secret variables and an environment variable as shown below.\n\n| Name         |   Type   | Path from git repository    | Description                                                                                                                                                                                                                                                                                                                                      |\n|--------------|:--------:|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| SSH_HOST     |  secret  | /settings/secrets/actions   | Your VPS IP address                                                                                                                                                                                                                                                                                                                              |\n| SSH_USER     |  secret  | /settings/secrets/actions   | Your ssh user name                                                                                                                                                                                                                                                                                                                               |\n| SSH_PASSWORD |  secret  | /settings/secrets/actions   | Your ssh user password                                                                                                                                                                                                                                                                                                                           |\n| PROJECT_NAME | variable | /settings/variables/actions | The name you want to give to the project. This name will be used to generate the Docker container as well as the subdomain and associated services (e.g. https://project-name.your-domain.wilders.dev, https://mailhog.project-name.your-domain.wilders.dev, etc.). ⚠️ Be careful not to use underscores in the project name but rather hyphens. |\n| APP_ENV      | variable | /settings/variables/actions | [optional]  Deployment environment (dev, test, prod)                                                                                                                                                                                                                                                                                             |\n\nNo prior configuration is required. Deployments are based on the Dockerfile and docker-compose.yml files integrated in\neach project.  \nThe projects are automatically cloned in the `~/projects` directory in the root of the user folder. The names of the git\nrepositories used to generate the associated databases. That's all!\n\nGithub CLI can be very useful to generate very quickly the secret variables from an `.env` file.\nSee [https://cli.github.com/manual/gh_secret_set](https://cli.github.com/manual/gh_secret_set) for further\ninformation.  \n\n### For JS template projects\nSame configuration as above. `js-project.sh` will be triggered by the Github action workflow.\n\n## Let's Encrypt SSL certificates explanations\n\nSSl certificates are generated by [Let's Encrypt](https://letsencrypt.org/) automatically each time a project is\ndeployed for the first time and store on the server in the `/traefik/data/acme.json` file. Certificates have\na [lifetime of 90 days](https://letsencrypt.org/2015/11/09/why-90-days.htm). You will receive renewal notifications by\ne-mail according to this period and for each domain name.\nTo regenerate one or more certificates, simply restart Traefik. Run the command below from the `/traefik` folder:\n\n```bash\nbash restart.sh\n```\n\n## Troubleshooting \u0026 useful commands\n\nIn the event of a problem, you can consult the real-time logs of each project's Docker images.\n\n```bash\ncd ~/traefik/deploy \u0026\u0026 bash logs-project.sh \u003cname-of-the-project-directory\u003e\n#example\n#cd ~/traefik/deploy \u0026\u0026 bash logs-project.sh 2023-03-remote-fr-project-1\n```\n\nIf needed, restart Docker\n\n```bash\nsudo service docker restart\n```\n\nClean stopped containers, dangling images and dangling build cache\n\n```bash\ndocker system prune -a\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildcodeschool%2Fvps-traefik-starter-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwildcodeschool%2Fvps-traefik-starter-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildcodeschool%2Fvps-traefik-starter-kit/lists"}