I have a docker container with odoo on port 8069 and another docker container with postgres on port 5432, I am mounting another container with nginx since the odoo container must handle two databases (db1-mydomain-com, db2 -mydomain-com) and the respective domains are db1.mydomain.com and db2.mydomain.com
The problem is that I am not aware of how to configure this correctly ... so that it is routed correctly, since I have no idea how nginx works. What I have done is the following:
Docker File:
FROM nginx
MAINTAINER Camptocamp
ADD
https://github.com/kelseyhightower/confd/releases/download/v0.11.0/confd-0.11.0-linux-amd64 /usr/local/bin/confd
RUN chmod +x /usr/local/bin/confd
RUN mkdir -p /etc/confd/{conf.d,templates}
COPY conf.d /etc/confd/conf.d
COPY templates /etc/confd/templates
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
ENV NGX_ODOO_HOST=odoo
CMD ["nginx", "-g", "daemon off;"]
docker-compose:
version: '3'
services:
nginx:
build:
context: ./
dockerfile: Dockerfile
ports:
- "80:80"
volumes:
- ./code:/code
- ./nginx.conf:/etc/nginx/conf.d/default.conf