Other parts:
Creates an external network
dev-proxy
to which frontend and backend containers are connected.
- Install Docker Desktop
- Copy
.env.example
and rename it to.env
- Set project name (the same for Traefik repo, Nuxt repo and Django repo if use all stack)
COMPOSE_PROJECT_NAME=orders
- Uncomment
Mode 1
block:# 1. As reverse-proxy for development on localhost with http COMPOSE_FILE=local.yml DOMAIN=localhost # or another aliace for 127.0.0.1 declared in etc/hosts
- Run
docker compose build
anddocker compose up -d
Traefik dashboard is available at: http://localhost:8080/dashboard/#/
- Set project name (the same for Traefik repo, Nuxt repo and Django repo if use all stack)
COMPOSE_PROJECT_NAME=orders
- Uncomment
Mode 2
block:# Mode 2: SSL-mode (with custom domain) COMPOSE_FILE=local.ssl.yml DOMAIN=orders.local
- Add local domain + subdomain for dashboard in
/etc/hosts
:127.0.0.1 localhost orders.local tr.orders.local
- Apply changes:
sudo killall -HUP mDNSResponder
- Install
mkcert
(or another tolls for local certificates) - Go to
./compose/local-ssl/cert/
- Generate a wildcard certificate for a local domain:
mkcert -cert-file orders.local.pem -key-file orders.local-key.pem orders.local "*.orders.local" # * for subdomains
- Install local CA certificate with the command:
mkcert -install
- If you use not
orders.local
- go to./compose/local-ssl/dynamic/
and edittls.yml
. Change the file names to your own - Run
docker compose build
anddocker compose up -d
Traefik dashboard is available at: https://tr.orders.local/dashboard/#/
Creates an external network
global
to which frontend and backend containers are connected.
- Copy
.env.example
and rename it to.env
on production server - Set project name (the same for Traefik repo, Nuxt repo and Django repo if use all stack)
COMPOSE_PROJECT_NAME=orders
- Uncomment
Mode 3
block and change domain and email:# Mode 3: As reverse-proxy for production COMPOSE_FILE=production.yml DOMAIN=orders.baikov.dev EMAIL=emailfor@letsencrypt.com # for Let's Encrypt resolver
- Run
docker compose build
anddocker compose up -d
- If the domain is correctly bound to the server, the certificate will be issued automatically with Let's Encrypt
Traefik dashboard is available at: https://tr.baikov.dev/dashboard/#/