The Compose file './docker-compose.yml' is invalid because: Unsupported config option for services.volumes: 'react_build' services.frontend.build contains unsupported option: 'contexts'

Can someone help me? I assume its indentation based off what I’ve read, but I can’t seem to figure out where (super new to docker) Thanks.

version: "3"

services:
  backend:
    build:
      context: ..django
    command: gunicorn core.wsgi --bind 0.0.0.0:8000 #allows you to see outside django container
    ports:
      - "8000:8000"

  frontend:
    build:
      contexts: ./react/blogapi
    volumes:
      - react_build:/react/build
  nginx:
    image: nginx:latest
    ports:
      - 80:8080
    volumes:
      - ./nginx/nginx-setup.config:/ect/nginx/conf.d/default.conf:ro
      - react_build:/var/www/react
    depends_on:
      - backend
      - frontend
  volumes:
    react_build:

Hi

The indentation in your yaml is not correct.
volumes should not be under services

1 Like