Home > Blockchain >  docker apache site without port
docker apache site without port

Time:12-16

My 1st real site developemnt so bear with me. I have a yml file that I use to spin up with docker-compose. This is run on a digital ocean droplet and the sitename is linked to it

version: "3.2"

    services:
      httpd:
        image: httpd:2.4.46-alpine
        ports:
          - 8080:80
        volumes:
          - type: bind
            source: ./main/
            target: /usr/local/apache2/htdocs/

the main folder structure looks like this with the index.html being a simple html page with references to the nj and oh directories which contain other html pages

enter image description here

I run docker compose and this yml file and sitename.com:8080 is where index.html loads to and not sitename.com

CodePudding user response:

If you want to access your site without specifying the port number in the URL, you should bind you host port 80 instead of the 8080. That way you won't need to specify port because 80 is the default.

In your example:

ports:
    - 80:80
  • Related