- Custom Docker Wordpress CLI Nginx
- Created At: 03/20/2025
- Version: 0.1.0
- Create a wordpress image from separate services using docker.
- Execute a minimum of instructions to create a new application.
- Generate a Let's encrypt certificate to serve application with https support.
- Be able to auto-install wordpress with custom URL and authentication credentials.
curl -Ls -O https://github.com/gulien/orbit/releases/download/v3.3.0/orbit_Linux_x86_64.tar.gz
tar -xzf orbit*.tar.gz orbit
sudo mv ./orbit /usr/local/bin && chmod +x /usr/local/bin/orbit
sudo apt install build-essential
cd /home/laptop && mkdir wp && cd wp
git clone https://github.com/pimeo/docker-wordpress-cli-nginx.git my-wp-project
cd my-wp-project
cp .example.env .env # Fill in with you environments values
nano .env
make generate_http_conf # Generate a nginx http conf. Required to start a server to request the let's encrypt certificate.
make autoinstall # Build and auto-install wordpressNote: you could also create a new git repository, duplicate the project, generate the nginx http configuration and use it as application to deploy to PAAS solution such as Dokploy or Portainer that do not offer possibility to run commands after cloning the project and before running the docker compose command.
In case you don't use the https support, it is recommended to comment the certbot service in docker-compose.yml.
// FR Il y aura 2 possibilités de déployer le projet dans ce cas:
- Déployer le projet sur la solution PAAS de votre choix. Il se lancera sur le port 80 pour l'URL que vous aurez choisi mais Wordpress ne s'installera pas automatiquement. Il faudra se connecter à l'instance Wordpress, aller dans
/var/www/htmlet lancer la commandmake autoinstallpour auto-installer wordpress. A prochain déploiement, la commande de base de docker compose suffira. - Si la solution PAAS vous le permet, lancer à la création de l'application la commande
make autoinstall. Pour tous les autres déploiement à venir, lancer la commandemake start. // /FR
cd /home/laptop && mkdir wp && cd wp
git clone https://github.com/pimeo/docker-wordpress-cli-nginx.git my-wp-project
cd my-wp-project
cp .example.env .env # Fill in with you environments values
nano .env
make generate_http_conf # Generate a nginx http conf. Required to start a server to request the let's encrypt certificate.
make autoinstall # Build and auto-install wordpress
sudo docker compose stop webserver # Stop webserver
make generate_https_conf # Generate a nginx https conf. Required to serve contents with ssl generated certificates
sudo docker compose up -d --force-recreate --no-deps webserver # Restart webserverNginx service must be stopped. Else the certificate won't be create and the webserver (listening to 80:443) will occur an error.
sudo systemctl stop nginx.service
sudo systemctl status nginx.service
make startmake destroyBe careful, it deletes everything..!