E
E
ENigma3712020-06-01 12:47:03
Docker
ENigma371, 2020-06-01 12:47:03

When creating Docker-Compose, I get an error not "class str"?

Good afternoon, tell me how to solve the problem. I wrote Docker-Compose and when I try to run it, I get errors yaml.scanner.ScannerError: mapping values ​​are not allowed here
in "./docker-compose.yml", line 2, column 9
That is, there is a curse on ":" after deletion all ":" new error pops up "Top level object in './docker-compose.yml' needs to be an object not ''."

version '3.8'
services:
  nginx:
    image: nginx:latest
    ports:
      - 80:80
    volumes:
      - ./hosts:/etc/nginx/conf.d
      - ./www:/var/www
      - ./logs:/var/log/nginx
    links:
      - php

  php:
    build: ./images/php
    links:
      - postgres
    volumes:
      - ./www:/var/www

  postgres:
    image: postgres:latest
    ports:
      - 5432:5432
    volumes:
      - ./postgres:/var/lib/postgres
    environment:
      - POSTGRES_DB=root
      - POSTGRES_USER=root
      - POSTGRES_PASSWORD=root

  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:8080

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question