Docker Compose Setup
This guide details how to set up a domain for your Docker Compose application.
Create DNS Record
- Add an
A
record to your DNS settings:- Name: Enter the route you want to point to (e.g.,
app
forapp.yourdomain.com
). - Value: Type in the IP address of your server, such as
1.2.3.4
.
- Name: Enter the route you want to point to (e.g.,
Docker Compose Domain Setup
To make a Docker Compose service or container accessible via a domain, add two things to your existing Docker Compose file.
Add the dokploy-network
network to each service.
Traefik labels to make the service accessible through the domain.
- if you are using the default Cloudflare configuration, add the following label:
traefik.http.routers.<unique-name>.entrypoints=web
- If you are using Let's Encrypt or Cloudflare's Full Strict mode, add the following labels:
traefik.http.routers.<unique-name>.entrypoints=websecure
traefik.http.routers.<unique-name>.tls.certResolver=letsencrypt
Example of a Basic docker-compose.yml
For example of a basic docker-compose.yml
file, refer to the Docker Compose Quickstart documentation.