Skip to content

Commit

Permalink
master - added self-signed companion
Browse files Browse the repository at this point in the history
  • Loading branch information
ionghitun committed Nov 24, 2024
1 parent f9d8c3f commit 620308e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
#image versions to use
NGINX_PROXY_VERSION=latest
ACME_COMPANION_VERSION=latest
SELF_SIGNED_VERSION=latest

#compose profile, leave empty to run only nginx-proxy
#possible values: acme, self-signed
COMPOSE_PROFILES=acme

#output of ~id -u and ~id -g commands
USER_ID=1000
GROUP_ID=1000
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ using docker, but also live ready.
### Installation notes

- Clone project
- copy `.env.example` to `.env` and use `id -u <user>` and `id -g <user>` to populate some of the fields.
- change other env variables to your needs
- Create global nginx-proxy network: `docker network create nginx-proxy`
- Build container using `docker-compose up -d`

Expand Down Expand Up @@ -56,9 +58,15 @@ You can use multiple domains/subdomains:
...
- nginx-proxy

When using self-signed companion you need to add `SELF_SIGNED_HOST: "example.com"` environment variable as well

- In `web/Dockerfile` you can include a conf where you define your servers, wildcards are not yet supported by acme
companion.
- When using in local environment the ssl certificates won't be created and a fallback to http will be created
automatically.
- Self-signed companion should be used only on a local environment.
- To use self-signed companion change `COMPOSE_PROFILES` to `self-signed` in .env

## Trust self-signed certificates

To avoid the alert "your connection is not private" please check self-signed repo: https://github.com/sebastienheyd/docker-self-signed-proxy-companion

_Happy coding!_
28 changes: 21 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
nginx-proxy:
image: nginxproxy/nginx-proxy:latest
container_name: nginx-proxy
proxy-nginx-proxy:
container_name: proxy-nginx-proxy
image: nginxproxy/nginx-proxy:${NGINX_PROXY_VERSION}
restart: unless-stopped
environment:
ENABLE_IPV6: 'true'
Expand All @@ -16,12 +16,12 @@ services:
- ./certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro

nginx-proxy-acme:
image: nginxproxy/acme-companion:latest
container_name: nginx-proxy-acme
proxy-acme-companion:
container_name: proxy-acme-companion
image: nginxproxy/acme-companion:${ACME_COMPANION_VERSION}
restart: unless-stopped
depends_on:
- nginx-proxy
- proxy-nginx-proxy
volumes:
- ./vhost:/etc/nginx/vhost.d
- ./html:/usr/share/nginx/html
Expand All @@ -33,6 +33,20 @@ services:
FILES_UID: ${USER_ID}
FILES_GID: ${GROUP_ID}
FILES_PERMS: 644
profiles:
- acme

proxy-self-signed-companion:
container_name: proxy-self-signed-companion
image: sebastienheyd/self-signed-proxy-companion:${SELF_SIGNED_VERSION}
restart: unless-stopped
depends_on:
- proxy-nginx-proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./certs:/etc/nginx/certs:rw
profiles:
- self-signed

networks:
default:
Expand Down

0 comments on commit 620308e

Please sign in to comment.