We use Traefik as a reverse proxy to route traffic to your containers. Traefik uses labels in your docker-compose.*.yml files to determine how to route traffic.
There are labels that you can apply to your services to customize the URL. Here is an example of a service in your docker-compose.dev.yml file:
services:
php:
labels:
- "traefik.enable=true"
- "traefik.http.routers.laravel-web.rule=Host(`laravel.dev.test`) || HostRegexp(`^.+\\.ngrok-free\\.app$`)"
- "traefik.http.routers.laravel-web.tls=true"
- "traefik.http.routers.laravel-web.entrypoints=websecure"
- "traefik.http.services.laravel-web.loadbalancer.server.port=8443"
- "traefik.http.services.laravel-web.loadbalancer.server.scheme=https"
You can see by default, we use laravel.dev.test as the URL, as long as supporting Ngrok's free plan by default. You can change this to any domain you'd like.
Just remember, you'll need to add the domain to your hosts file to make sure your computer knows where to route the traffic.
Connecting to your database
Connecting to your database with a GUI manager like TablePlus or Sequel Ace is a must for many developers. This guide will walk you through how we can connect to your database in development and production.
Customizing The Docker Image
This guide will walk you through how to customize your Docker image for your project. You can add additional packages, change the PHP version, or even add additional services to your Docker image.