Skip to content

Cookie settings

Choose which kinds of cookies you allow. You can change your choice at any time via Cookie settings at the bottom of every page. Privacy statement

Necessary

Always on

Needed to log in, keep your cart and remember your choices. These are always on.

Which cookies?
  • weboke_sessie, weboke_klant, weboke_remember: your session and staying logged in
  • weboke_basket: your cart
  • wkBtwIncl: showing prices with or without VAT
  • wok_cookies: your cookie choice, 12 months

Measures which ad leads to a visit or order, so we do not pay for ads that do nothing.

Which cookies?
  • Google Ads via Google Tag Manager (_gcl_au, _gcl_aw), up to 90 days
  • OpenAI Ads, ads in ChatGPT
  • wok_aff: which partner referred you to us (affiliate programme), 60 days

4.6

Country and language

Each country has its own site, with prices and VAT for that country.

View

Your working folder with compose.yaml, .env and Caddy

With docker compose you describe all your containers in one file. In this guide, all apps live in the folder /srv/diensten, with Caddy as the front door that handles https for every app. The recipes in chapter 7 each add a little piece to this. To learn how compose and the firewall work together, read Docker compose and the firewall in the VPS and Linux server administration course.

The folder and the files

anna@web1:~$ sudo mkdir -p /srv/diensten
anna@web1:~$ cd /srv/diensten
anna@web1:/srv/diensten$ sudo nano compose.yaml

Start with just Caddy:

services:
  caddy:
    image: caddy:2
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - caddy-data:/data
      - caddy-config:/config

volumes:
  caddy-data:
  caddy-config:

And the Caddyfile in the same folder:

{
	email beheer@example.com
}

A version: line at the top is no longer needed; you will still see it in older examples.

Starting and viewing

anna@web1:/srv/diensten$ sudo docker compose up -d
anna@web1:/srv/diensten$ sudo docker compose ps
anna@web1:/srv/diensten$ sudo docker compose logs -f caddy

up -d starts everything in the background. Press Ctrl+C to stop following the logs; the containers keep running. If you change the Caddyfile, reload it with:

anna@web1:/srv/diensten$ sudo docker compose exec -w /etc/caddy caddy caddy reload

Secrets in .env

Don't put passwords and tokens in compose.yaml. Put them in a .env file in the same folder instead. In compose.yaml you refer to them with ${NAAM}.

anna@web1:/srv/diensten$ sudo nano .env
anna@web1:/srv/diensten$ sudo chmod 600 .env

Never put .env in Git and don't share it.

Is Caddy already running as a service on your server?

If you installed Caddy or nginx as in chapter 5, ports 80 and 443 are already in use. Choose one of two options:

  • Turn off the service on the server (sudo systemctl disable --now caddy or nginx) and move your sites to the Caddyfile in /srv/diensten. This is what the recipes assume.
  • Or keep the service on the server, leave Caddy out of compose, and publish each app only on 127.0.0.1 (see Docker and the firewall: publishing ports safely). You then set up a reverse proxy for each app as in An app behind a reverse proxy.

One moment…

Set up your domains

For each domain, arrange the nameservers, the link to your hosting and who becomes the owner.

Loading your domains…