Yendor
June 28, 2019, 8:49pm
#1
Hi,
I would like to intergrate Nginx and Letsencrypt into the docker compose yaml @ loraserver-docker
Before I start I would like to know if any one has already done this and would be will to share there yaml or how that did it.
I am currently looking at nginx-proxy and docker-letsencrypt-nginx-proxy-companion as docker soltion foe Nginx and Letsencrypt.
Thanks
Yendor
June 30, 2019, 2:37am
#2
OK, so I got something going. I ended up breaking it in to two docker-compose files nginx-docker\docker-compose.yml
and loraserver-docker\docker-compose.yml
. Its up and running and I can get to the app server, some page are not showing like the https://example.com/#/organizations/2/users/create
I just get a blank page (working on debugging this and seeing what else is broken).
Anyways if anyone is interested here are my docker compose files.
nginx-docker\docker-compose.yml
version: "3"
services:
nginx-proxy:
restart: always
image: jwilder/nginx-proxy
container_name: nginx-proxy
security_opt:
- label:type:docker_t
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock
- letsencrypt-certs:/etc/nginx/certs:ro
- nginx-vhost:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
- nginx-conf:/etc/nginx/conf.d
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
letsencrypt-nginx-proxy-companion:
restart: always
image: jrcs/letsencrypt-nginx-proxy-companion:latest
depends_on:
- nginx-proxy
security_opt:
- label:type:docker_t
environment:
NGINX_PROXY_CONTAINER: nginx-proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- letsencrypt-certs:/etc/nginx/certs
- nginx-vhost:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
volumes:
letsencrypt-certs:
driver_opts:
type: none
device: /etc/letsencrypt/certs
o: bind
nginx-conf:
driver_opts:
type: none
device: /etc/nginx/conf.d
o: bind
nginx-vhost:
driver_opts:
type: none
device: /etc/nginx/vhost.d
o: bind
nginx-html:
driver_opts:
type: none
device: /var/www/html
o: bind
networks:
default:
external:
name: nginx-proxy
loraserver-docker\docker-compose.yml
version: "3"
services:
loraserver:
image: loraserver/loraserver:3
volumes:
- ./configuration/loraserver:/etc/loraserver
appserver:
image: loraserver/lora-app-server:3
ports:
- 8080:8080
environment:
# HOSTNAME: example.com
VIRTUAL_HOST: example.com
VIRTUAL_NETWORK: nginx-proxy
VIRTUAL_PORT: 8080
LETSENCRYPT_HOST: example.com
LETSENCRYPT_EMAIL: me@example.com
volumes:
- ./configuration/lora-app-server:/etc/lora-app-server
gatewaybridge:
image: loraserver/lora-gateway-bridge:3
ports:
- 1700:1700
environment:
# HOSTNAME: router.example.com
VIRTUAL_HOST: router.example.com
VIRTUAL_NETWORK: nginx-proxy
VIRTUAL_PORT: 1700
LETSENCRYPT_HOST: router.example.com
LETSENCRYPT_EMAIL: me@example.com
volumes:
- ./configuration/lora-gateway-bridge:/etc/lora-gateway-bridge
geoserver:
image: loraserver/lora-geo-server:3
volumes:
- ./configuration/lora-geo-server:/etc/lora-geo-server
postgresql:
image: postgres:9.6-alpine
volumes:
- ./configuration/postgresql/initdb:/docker-entrypoint-initdb.d
- postgresqldata:/var/lib/postgresql/data
redis:
image: redis:5-alpine
volumes:
- redisdata:/data
mosquitto:
image: eclipse-mosquitto
ports:
- 1883:1883
environment:
# HOSTNAME: mqtt.example.com
VIRTUAL_HOST: mqtt.example.com
VIRTUAL_NETWORK: nginx-proxy
VIRTUAL_PORT: 1883
LETSENCRYPT_HOST: mqtt.example.com
LETSENCRYPT_EMAIL: me@example.com
volumes:
postgresqldata:
redisdata:
networks:
default:
external:
name: nginx-proxy