Skip to content

Latest commit

 

History

History
71 lines (53 loc) · 2.3 KB

README.md

File metadata and controls

71 lines (53 loc) · 2.3 KB

Directus

Caddy as reverse proxy for Directus, with MariaDB and phpMyAdmin.

🚀 Quick start

Download the compose.yaml file:

curl -O https://raw.githubusercontent.com/gremo/compose-selfhosted/main/src/directus/compose.yaml

Create an empty .env file to hold environment variables:

touch .env

Tip

You can populate secrets in the .env file randomly:

{
 echo "KEY=$(uuidgen -r)"
 echo "SECRET=$(uuidgen -r)"
 echo "DB_PASSWORD=$(head /dev/urandom | tr -dc 'A-Za-z0-9@$%&_+' | head -c10)"
 echo
} >> .env

⚙️ Environment variables

Important

Database root password is random, after starting the project run docker compose logs | grep -i "GENERATED ROOT PASSWORD" and note it.

Supported variables:

Variable Required Default Description
DOMAIN localhost The domain name
ADMIN_EMAIL Y Administrator email
ADMIN_PASSWORD Y Administrator password
KEY Y Unique identifier for the project
SECRET Y Secret string for the project
DB_USER directus User for the DB_NAME database
DB_PASSWORD Y Password for the DB_NAME database
DB_NAME directus Database name

Note

All other Directus environment variables are suppoorted too, being .env mounted to /directus/.env.

🌐 Endpoints

docker compose up -d
Endpoint Service
http://localhost Directus
http://localhost/phpmyadmin phpMyAdmin

🪄 Tips

A www redirection to non-www can be performed adding the following labels to the caddy service:

labels:
  caddy: www.${DOMAIN:-localhost}
  caddy.redir: "http://${DOMAIN:-localhost}{uri}"