With normal docker-compose
it does try to start (but I have an issue in the build).
Why it does not work with docker compose
?
ls -la ./docker/local/
total 20
drwxrwxr-x 4 jorgee jorgee 4096 abr 11 19:37 .
drwxrwxr-x 3 jorgee jorgee 4096 abr 11 16:54 ..
drwxrwxr-x 3 jorgee jorgee 4096 abr 11 16:59 base_wordpress
drwxrwxr-x 4 jorgee jorgee 4096 abr 11 16:53 configs
-rw-rw-r-- 1 jorgee jorgee 995 abr 11 19:37 docker-compose.yaml
docker compose --file ./docker/local/docker-compose.yaml -p nhco-be start
no container found for project "nhco-be": not found
version: '3.5'
services:
mysql:
image: 'mysql:8.0'
working_dir: /application
volumes:
- '.:/application'
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=nhco
- MYSQL_USER=nhco
- MYSQL_PASSWORD=nhco
ports:
- '8082:3306'
webserver:
image: 'nginx:alpine'
working_dir: /application
volumes:
- '../../wp-content:/application/wp-content'
- './configs/nginx/nginx.conf:/etc/nginx/conf.d/default.conf'
ports:
- '8080:80'
php-fpm:
build: configs/php-fpm
working_dir: /application
environment:
- DB_HOST=mysql
- DB_NAME=nhco
- DB_USER=nhco
- DB_PASSWORD=nhco
volumes:
- '../../wp-content:/application/wp-content'
- './configs/php-fpm/php-ini-overrides.ini:/etc/php/8.3/fpm/conf.d/99-overrides.ini'
2
Answers
This might be because the docker compose command was replaced with docker-compose as part of the transition to Docker Compose V2.
The docker compose is a newer project to migrate compose to Go with the rest of the docker project, it is the v2 branch of the docker/compose repo. The v1 branch of the docker/compose repo uses docker-compose command instead. There might be additional verifications in the build process of the more recent docker compose command which might explain why it refuses to start but with the docker-compose command it tries to start