I am new to Docker, and I am trying to follow a basic tutorial on how to set up a reverse proxy with Docker and nginx(How to set up NGINX Docker Reverse Proxy? - DEV Community), but after simply creating a container with the docker-compose.yml and index.html, I tried to run the docker-compose build command to start the container. However, I keep getting the same error “services must be a mapping”. Does anyone know why I might be getting this error? I posted the link to the website tutorial I’m following, but here’s the code I’m trying out :
version: '2' services: app: image: nginx:1.9 volumes: - .:/usr/share/nginx/html/ expose: - "80"
And index.html has:
<!DOCTYPE html> <html> <head> <title>Web service 1</title> </head> <body> <h1>Welcome to website 1</h1> </body> </html>
But for some reason docker-compose build fails.