Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version #70

Open
rk610 opened this issue Jun 16, 2022 · 0 comments

Comments

@rk610
Copy link

rk610 commented Jun 16, 2022

Here's my docker-compose.yml file:

`version: '3.9'

services:
composer:
image: composer
command: update
volumes:
- ./wordpress:/app

mysql:
image: mysql:8.0
volumes:
- mysql_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
volumes:
- ./mysql:/var/lib/mysql

phpmyadmin:
image: phpmyadmin/phpmyadmin
depends_on:
- mysql
environment:
PMA_HOST: mysql
PMA_PORT: 3306
PMA_ARBITRARY: 1
restart: always
ports:
- 8183:80

wordpress:
depends_on:
- mysql
- composer
image: wordpress:latest
ports:
- "8020:80"
restart: always
environment:
WORDPRESS_DB_HOST: mysql:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
volumes:
- ./wordpress:/var/www/html

volumes:
mysql_data: {} `

If I run docker-compose -f backend/docker-compose.yml up I get this:

ERROR: Version in "./backend/docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

My docker compse ver is::
Docker version 18.09.7, build 2d0083d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant