- Joined
- Jun 16, 2017
- Messages
- 22
- Reaction score
- 3
Has anyone tried this? I've searched around, but I haven't found anything.
It should be fairly straightforward to set up a Dockerfile that pulls from Debian 8 and loads up 3CX, so the real challenge will be setting up the nginx reverse-proxy. I'll start playing around with it, but any suggestions are greatly appreciated.
If anyone has 3CX running behind an nginx reverse-proxy, I would LOVE to see your config!
I'll post a docker-compose.yml file here if/when I ever get this going properly.
For starters, here's my standard docker-compose.yml for nginx-proxy/letsencrypt. Note that there is no "networks" config -- it will create "nginx_default" (i put it in a folder named "nginx") that you attach other containers to behind it:
For example, a Wordpress container connected to the proxy:
There REALLY shouldn't be any reason why this won't work! Like I said, I think it is just a matter of getting a proper reverse-proxy config file set up.
It should be fairly straightforward to set up a Dockerfile that pulls from Debian 8 and loads up 3CX, so the real challenge will be setting up the nginx reverse-proxy. I'll start playing around with it, but any suggestions are greatly appreciated.
If anyone has 3CX running behind an nginx reverse-proxy, I would LOVE to see your config!
I'll post a docker-compose.yml file here if/when I ever get this going properly.
For starters, here's my standard docker-compose.yml for nginx-proxy/letsencrypt. Note that there is no "networks" config -- it will create "nginx_default" (i put it in a folder named "nginx") that you attach other containers to behind it:
Code:
version: '2'
services:
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
- ./vhost.d:/etc/nginx/vhost.d
- /usr/share/nginx/html
- ./certs:/etc/nginx/certs:ro
- ./conf.d/:/etc/nginx/conf.d
- /var/run/docker.sock:/tmp/docker.sock:ro
restart: always
letsencrypt-nginx-proxy-companion:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt-nginx-proxy-companion
volumes_from:
- nginx-proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./certs:/etc/nginx/certs:rw
restart: always
For example, a Wordpress container connected to the proxy:
Code:
version: '2'
services:
db-wordpress:
image: mysql:5.7
container_name: db-wordpress
volumes:
- ./db-wordpress:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=wordpress
- MYSQL_DATABASE=wordpress
- MYSQL_USER=wordpress
- MYSQL_PASSWORD=wordpress
networks:
- proxy-tier
restart: always
wordpress:
depends_on:
- db-wordpress
image: wordpress
container_name: wordpress
volumes:
- ./html:/var/www/html
environment:
- WORDPRESS_DB_HOST=db-wordpress:3306
- WORDPRESS_DB_PASSWORD=wordpress
- WORDPRESS_DB_USER=wordpress
- VIRTUAL_HOST=example.com,www.example.com
- LETSENCRYPT_HOST=example.com,www.example.com
- [email protected]
networks:
- proxy-tier
restart: always
networks:
proxy-tier:
external:
name: nginx_default
There REALLY shouldn't be any reason why this won't work! Like I said, I think it is just a matter of getting a proper reverse-proxy config file set up.