ERROR: yaml.parser.ParserError: while parsing a block mapping in "./docker-compose.yml", line 1, column 1
expected <block end>, but found '<block mapping start>' in "./docker-compose.yml", line 2, column 3
Il semble qu'il y ait un problème d'indentation dans mon fichier yml. J'ai lu quelques autres questions ici, et essayé divers schémas d'indentation. Je n'arrive toujours pas à le faire fonctionner. J'ai volontairement enlevé les noms d'env/pws avant de poster cette question.Comment réparer mon docker-compose.yml? - <block end> attendu, mais trouvé '<block mapping start>'
version: '2'
ghost:
image: ghost:latest
container_name: ghost-blog #Specify a custom container name, rather than a generated default name.
environment:
- NODE_ENV=production
- MYSQL_DATABASE=db-name # Change {{db-name}}
- MYSQL_USER=user # Change {{username}}
- MYSQL_PASSWORD=pass # Change {{db-password}}
# - "MAILGUN_USER={{mailgun-user}}" # Change {{mailgun-user}}
# - "MAILGUN_PASSWORD={{mailgun-password}}" # Change {{mailgun-password}}
volumes:
- ./ghost:/var/lib/ghost # persist the data
ports:
- 2368:2368
depends_on:
- mysql # ensure that the database will start first
restart: always
mysql:
image: mysql:latest
container_name: ghost-db
environment:
- MYSQL_DATABASE=dbname # Change {{db-name}}
- MYSQL_ROOT_PASSWORD=db-pass # Change {{root-password}}
- MYSQL_USER=user # Change {{username}}
- MYSQL_PASSWORD=sq-pass # Change {{db-password}}
volumes:
- ./db:/var/lib/mysql
restart: always
Je pense que vous manquez les services: tag comme il a ici https://docs.docker.com/compose/gettingstarted/#step-3-define-services-in-a-compose-file –