-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nginx): add docs and support for adding local TLS certificates
- Loading branch information
1 parent
18a684f
commit 0b0e027
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
*/.env | ||
.env | ||
|
||
node_modules/ | ||
node_modules/ | ||
nginx/certs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version : '3' | ||
|
||
services: | ||
ingress: | ||
volumes: | ||
- ./nginx/certs/magento2.test.key:/etc/nginx/certs/nginx.key | ||
- ./nginx/certs/magento2.test.pem:/etc/nginx/certs/nginx.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# TLS Certificates | ||
|
||
When working locally, its important to consider the end-user of your software. To mimic this as closely as possible, you will need to setup a local TLS certificate. Luckily, doing so is pretty easy with [mkcert](https://github.com/FiloSottile/mkcert). | ||
|
||
## Getting Started | ||
To begin, start by [installing on your system](https://github.com/FiloSottile/mkcert#installation). | ||
|
||
Once installed, we'll quickly generate our local CA. | ||
|
||
```bash | ||
mkcert -install | ||
``` | ||
|
||
Next, we'll generate a certificate and put it in the right directory for Mage2Docker. | ||
|
||
```bash | ||
mkcert -key-file magento2.test.key -cert-file magento2.test.pem magento2.test | ||
mv magento2.test.key nginx/certs/magento2.test.key && mv magento2.test.pem nginx/certs/magento2.test.pem | ||
``` | ||
|
||
## Enabling Local Cert Mounting with Mage2Docker | ||
Now, simply append the `docker-compose.TLS.yml` path to your `.env` file and bring your containers up `docker-compose up`. | ||
|
||
``` | ||
COMPOSE_FILE=docker-compose.yml:...:docker-compose.TLS.yml | ||
``` | ||
|
||
At this point, you should have a working TLS cert covering the `magento2.test` domain! |