strapi-docker: cannot start container strapi:latest

Hello I tryed to run strapi + mongodb on docker (making them run from portainer) but it crashes at start

ENV parameters:

parameter value
DATABASE_CLIENT MongoDB
DATABASE_HOST mongodb_strapi
DATABASE_USERNAME *****
DATABASE_PASSWORD *****
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
NODE_VERSION 9.11.1
YARN_VERSION 1.5.1
DATABASE_NAME strapi
DATABASE_PORT 27017
DATABASE_SSL false

error from docker logs:

šŸš€ Start creating your Strapi application. It might take a minute, please take a coffee ā˜•ļø
Lets configurate the connection to your database:
Database determined by CLI args: MongoDB
(node:6) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'value' of undefined
    at inquirer.prompt.then.answers (/usr/local/lib/node_modules/strapi/node_modules/strapi-generate-new/lib/before.js:111:53)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:182:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:697:11)
    at startup (internal/bootstrap/node.js:201:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
(node:6) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
./strapi.sh: cd: line 28: can't cd to strapi-app

docker engine version:

parameter value
Version 18.06.0-ce
API version 1.38
Go version go1.10.3
OS type linux
OS Ubuntu 16.04.5 LTS
Architecture amd64
Kernel version 4.13.0-1012-gcp

thank you!

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 15 (8 by maintainers)

Most upvoted comments

Same here: Attaching to strapi_api_1 api_1 | šŸš€ Start creating your Strapi application. It might take a minute, please take a coffee ā˜•ļø api_1 | api_1 | Lets configurate the connection to your database: api_1 | Database determined by CLI args: mongo api_1 | api_1 | ā³ Testing database connection… api_1 | { Error: Cannot find module ā€˜/tmp/strapie0ea507fb540/node_modules/strapi-hook-mongoose/lib/utils/connectivity.js’ api_1 | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15) api_1 | at Function.Module._load (internal/modules/cjs/loader.js:475:25) api_1 | at Module.require (internal/modules/cjs/loader.js:598:17) api_1 | at require (internal/modules/cjs/helpers.js:11:18) api_1 | at Promise.all.then (/usr/local/lib/node_modules/strapi/node_modules/strapi-generate-new/lib/before.js:259:15) api_1 | at <anonymous> code: ā€˜MODULE_NOT_FOUND’ }

Yap! You will have to use the same config as a MySQL database. But you set the HOST and PORT of your MariaDB database. It’s because it uses the same driver as MySQL

Thank you @maxime1992 ! We are doing our best to have to best product with the best community!

Hello @maxime1992 ! Thank you for this message, we know we have some hard work to do to make the switch easy as it’s easy to build your API. There is a ticket in our roadmap - https://portal.productboard.com/strapi/c/12-migrate-across-environments - feel free to add a comment to help us to build this feature the better we can.

Your DATABASE_CLIENT environment variable should be one of:

  • mongo
  • postgres
  • mysql