How to run docker nginx on ubuntu server 16?

Question:

I have a bunch of docker containers nginx / php-fpm / mysql. They are run and managed via docker-compose. Through volume, I mount my application there. And there is an ubuntu server with a configured domain.

How can I make the requests to the server go to the container with nginx?

Answer:

You need to set a value for the ports parameter for your nginx service

version: 3.1
services:
    ...
    nginx:
        ...
        ports:
          - "444:443"

to open nginx for HTTPS access or "80:80" for HTTP

Scroll to Top