https://github.com/trco/wordpress-nginx-ssl-docker
SSL enabled Wordpress website with Nginx and Docker.
https://github.com/trco/wordpress-nginx-ssl-docker
Last synced: 4 months ago
JSON representation
SSL enabled Wordpress website with Nginx and Docker.
- Host: GitHub
- URL: https://github.com/trco/wordpress-nginx-ssl-docker
- Owner: trco
- Created: 2019-09-08T17:54:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-09-15T20:37:15.000Z (almost 6 years ago)
- Last Synced: 2025-02-24T05:46:43.904Z (over 1 year ago)
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wordpress-nginx-ssl-docker
SSL enabled Wordpress website with Nginx and Docker. Inspired by [SSD Nodes blog post](https://blog.ssdnodes.com/blog/host-multiple-ssl-websites-docker-nginx/).
## Prerequisites
1. A server running Linux (tested with Ubuntu 18.04)
2. Docker and Docker Compose installed on your server
3. A registered domain name
4. A DNS A records set up for your server
## Setup
1. SSH into your server, create new folder and clone the repository into it:
```
$ mkdir example && cd example
$ git clone https://github.com/trco/wordpress-nginx-ssl-docker.git .
```
2. Create .env file in root folder and add following variables:
```
MYSQL_ROOT_PASSWORD=example_root_password
MYSQL_DATABASE=example_database
MYSQL_USER=example_user
MYSQL_PASSWORD=example_password
VIRTUAL_HOST=example.com
LETSENCRYPT_HOST=example.com
LETSENCRYPT_EMAIL=example@gmail.com
```
3. Run `docker network create nginx-proxy` to create a unique network for nginx-proxy and other Docker containers to communicate through.
4. Run `docker-compose up -d` inside of nginx-proxy folder. Three containers should initialize:
```
Starting nginx-proxy ... done
Starting nginx-proxy-gen ... done
Starting nginx-proxy-letsencrypt ... done
```
5. Check that containers are up and running with `docker-compose ps`. Debug with `docker-compose logs `.
6. Run `docker-compose up -d` inside of the root directory. Two containers should initialize:
```
Starting db ... done
Starting app ... done
```
7. Check that containers are up and running with `docker-compose ps`. Debug with `docker-compose logs `.
8. Visit your domain and proceed with Wordpress installation.
## Notes
- You can run multiple dockerized Wordpress websites on single server. Just follow the setup for each website separately.
- You can rename all the containers inside of both docker-compose.yml files.
## SSL certificate force renewal & check status
```
$ docker exec -it bash
# force renewal
$ source /app/letsencrypt_service --source-only
$ update_certs --force-renew
# check status
$ ./cert_status
```