Search code examples
dockernginxdocker-machine

docker-machine instance not running on port 8080


I am trying to get this tutorial to work. But at the end of the tutorial it says to run http://192.168.99.100:8080 and see your website. But it is not showing up for me at all after running docker-machine ls. There are no entries at all. So my question is how can I get a docker-machine instance running on an nginx container? I assume that is the one that runs the wwwroot folder, that is what points to it and has all of the port and root calls for the server. My code in the docker-compose.yml is the same as the tutorial but here it is:

version: '2'
services:
  nginx:
    build:
      context: .
      dockerfile: docker.nginx
    image: my-nginx
    container_name: my-nginx-container
    ports:
      - "8080:8080"
    volumes:
      - wwwroot:/wwwroot
  webpack:
    build:
      context: .
      dockerfile: docker.webpack
    image: my-webpack
    container_name: my-webpack-container
    ports:
      - "35729:35729"
    volumes:
      - ./app:/app
      - /app/node_modules
      - wwwroot:/wwwroot
volumes:
  wwwroot:
    driver: local

Solution

  • From the comments, it has been established that your docker machine is running and the server you are trying to run is running on localhost:8080.

    Before you run docker compose up, make sure that the directory contains other required files and folders, examplenginx.conf and index.html.