This is a boilerplate for self hosting Directus on Docker Compose. It uses Nginx as a reverse proxy and Let's Encrypt to provide SSL certificates.
It is based on the official Directus Docker image and the Nginx Docker image.
The certbot configuration is taken from the nginx-certbot repository and the original article it's worth a read if you want to dive deeper: Nginx and Let’s Encrypt with Docker in Less Than 5 Minutes.
The script to validate the nginx configuration is taken from this article.
You need to have Docker and Docker Compose installed on your machine.
clone this repo and edit the docker-compose.yml
and the nginx/default.conf
files to your needs.
# provision certificates
./init-letsencrypt.sh
# test nginx configuration
./test-nginx.sh
# start the containers
docker-compose up -d
Feel free to open an issue or submit a pull request.
Things I would like to add:
This project is open source and available under the MIT License.
# start the containers
docker-compose up -d
# stop the containers
docker-compose down
# rebuild the containers
docker-compose up -d --build
# list containers
docker ps
# list all containers
docker ps -a
# list images
docker images
# list volumes
docker volume ls
# remove all containers
docker rm $(docker ps -a -q)
# remove all images
docker rmi $(docker images -q)
# remove all volumes
docker volume rm $(docker volume ls -q)
# remove all unused containers, volumes, networks and images
docker system prune