numberninecms / cms

Core code of NumberNine CMS
https://numberninecms.com
MIT License
19 stars 0 forks source link

Documentation : can't execute command ??? #62

Open celtic34fr opened 2 years ago

celtic34fr commented 2 years ago

Hi, After installing numberninecms with docker, as show in the documentation (Installation Docker one-liner), I want to create database and admin user.

in shell, in my project folder, i try to execute : docker-compose exec php bin/console numbernine:user:create --admin

I obtain this answer : ERROR: No container found for php_1

I've the same answer for other commands show in your documentation.

When i try to execute : docker-composer up

It will launch the application, but i can't access to the docker instance and try to execute commands in its own shell. Can you help mye please ?

Gilbert ARMENGAUD Celtic34fr Béziers - Occitanie - France

williarin commented 2 years ago

Hi, thanks for the feedback. I can't reproduce your problem. What OS, Docker Desktop and Compose versions are you using?

celtic34fr commented 2 years ago

Hi, I used Ubuntu 21.10 OS, and my docker version are :

williarin commented 2 years ago

I'm not sure but the problem might come from Compose. Is there a way you can test with Compose v2 ? Try to replace docker compose instead of the dashed docker-compose.

On Docker Desktop for Windows/WSL, docker-compose is just an alias of docker compose so that might be why I can't reproduce the problem.

celtic34fr commented 2 years ago

OK, I'll take time to search docker or docker-ce without docker-composer as i use,. When i try to exec the command with 'docker compose' instead of 'docker-compose', the command return the help man, and in the command list, i don't find compose. Can you give me the version of docker that you use under Windows WSL ?

williarin commented 2 years ago

I use docker engine 20.10.14 with compose 2.4.1, the Github CI uses compose 2.4.1 as well.

If upgrading compose doesn't solve the problem:

  1. check what containers are running with docker container ls. You should see 5 containers running prefixed with myproject_ or the name you gave to your app
  2. delete all these prefixed containers
  3. check that docker-compose.yml is present in the directory, and that's it's similar to this file https://github.com/numberninecms/cms/blob/master/install/docker-compose.yml
  4. restart the stack with docker-compose up

Maybe the installation silently failed and didn't copy all necessary files? You can also launch the installation with debug mode by suffixing the command with -v:

docker run --rm --pull=always -t -e HOST_PWD=$PWD \
    -v $PWD:/srv/app -v /var/run/docker.sock:/var/run/docker.sock \
    numberninecms/installer myproject -v