strapi / strapi-docker

Install and run your first Strapi project using Docker
https://strapi.io
MIT License
1.16k stars 447 forks source link

docker image failed to start #277

Open hbakhtiyor opened 3 years ago

hbakhtiyor commented 3 years ago

just followed the instruction of the guide with such docker-compse.yaml

version: '3'
services:
  strapi:
    image: strapi/strapi
    environment:
      DATABASE_CLIENT: postgres
      DATABASE_NAME: strapi
      DATABASE_HOST: postgres
      DATABASE_PORT: 5432
      DATABASE_USERNAME: strapi
      DATABASE_PASSWORD: strapi
    volumes:
      - ./app:/srv/app
    ports:
      - '1337:1337'
    depends_on:
      - postgres

  postgres:
    image: postgres
    environment:
      POSTGRES_DB: strapi
      POSTGRES_USER: strapi
      POSTGRES_PASSWORD: strapi
    volumes:
      - ./data:/var/lib/postgresql/data

and got such error

Starting your app...

Error loading the local develop command. Strapi might not be installed in your "node_modules". You may need to run "npm install"

os: windows 10 home

image

derrickmehaffy commented 3 years ago

Can you provide the logs from the Strapi container?

hbakhtiyor commented 3 years ago
Creating network "strapi_default" with the default driver
Creating strapi-db ... done
Creating strapi-app ... done
Attaching to strapi-db, strapi-app
strapi-db   | The files belonging to this database system will be owned by user "postgres".
strapi-db   | This user must also own the server process.
strapi-db   |
strapi-db   | The database cluster will be initialized with locale "en_US.utf8".
strapi-db   | The default database encoding has accordingly been set to "UTF8".
strapi-db   | The default text search configuration will be set to "english".
strapi-db   |
strapi-db   | Data page checksums are disabled.
strapi-db   |
strapi-db   | fixing permissions on existing directory /var/lib/postgresql/data ... ok
strapi-db   | creating subdirectories ... ok
strapi-db   | selecting dynamic shared memory implementation ... posix
strapi-db   | selecting default max_connections ... 100
strapi-db   | selecting default shared_buffers ... 128MB
strapi-db   | selecting default time zone ... Etc/UTC
strapi-db   | creating configuration files ... ok
strapi-db   | running bootstrap script ... ok
strapi-app  | Using strapi 3.4.6
strapi-app  | No project found at /srv/app. Creating a new strapi project
strapi-db   | performing post-bootstrap initialization ... ok
strapi-app  | Creating a new Strapi application at /srv/app.
strapi-app  |
strapi-app  | Creating a project from the database CLI arguments.
strapi-app  | Creating files.
strapi-app  | - Installing dependencies:
strapi-db   | syncing data to disk ... initdb: warning: enabling "trust" authentication for local connections
strapi-db   | You can change this by editing pg_hba.conf or using the option -A, or
strapi-db   | --auth-local and --auth-host, the next time you run initdb.
strapi-db   | ok
strapi-db   |
strapi-db   |
strapi-db   | Success. You can now start the database server using:
strapi-db   |
strapi-db   |     pg_ctl -D /var/lib/postgresql/data -l logfile start
strapi-db   |
strapi-db   | waiting for server to start....2021-02-18 03:14:37.575 UTC [48] LOG:  starting PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
strapi-db   | 2021-02-18 03:14:37.673 UTC [48] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
strapi-db   | 2021-02-18 03:14:38.013 UTC [49] LOG:  database system was shut down at 2021-02-18 03:13:22 UTC
strapi-db   | 2021-02-18 03:14:38.224 UTC [48] LOG:  database system is ready to accept connections
strapi-db   |  done
strapi-db   | server started
strapi-db   | CREATE DATABASE
strapi-db   |
strapi-db   |
strapi-db   | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
strapi-db   |
strapi-db   | 2021-02-18 03:15:03.591 UTC [48] LOG:  received fast shutdown request
strapi-db   | waiting for server to shut down....2021-02-18 03:15:03.648 UTC [48] LOG:  aborting any active transactions
strapi-db   | 2021-02-18 03:15:03.652 UTC [48] LOG:  background worker "logical replication launcher" (PID 55) exited with exit code 1
strapi-db   | 2021-02-18 03:15:03.658 UTC [50] LOG:  shutting down
strapi-db   | 2021-02-18 03:15:04.294 UTC [48] LOG:  database system is shut down
strapi-db   |  done
strapi-db   | server stopped
strapi-db   |
strapi-db   | PostgreSQL init process complete; ready for start up.
strapi-db   |
strapi-db   | 2021-02-18 03:15:04.723 UTC [1] LOG:  starting PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
strapi-db   | 2021-02-18 03:15:04.724 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
strapi-db   | 2021-02-18 03:15:04.724 UTC [1] LOG:  listening on IPv6 address "::", port 5432
strapi-db   | 2021-02-18 03:15:04.900 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
strapi-db   | 2021-02-18 03:15:05.086 UTC [76] LOG:  database system was shut down at 2021-02-18 03:15:04 UTC
strapi-db   | 2021-02-18 03:15:05.200 UTC [1] LOG:  database system is ready to accept connections
strapi-app  | Error while installing dependencies:
strapi-app  | warning strapi > boom@7.3.0: This module has moved and is now available at @hapi/boom. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
strapi-app  | warning strapi > koa-ip > debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
strapi-app  | warning strapi > boom > hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
strapi-app  | warning strapi > chokidar > fsevents@2.1.3: "Please update to latest v2.3 or v2.2"
strapi-app  | warning strapi-admin > @babel/polyfill@7.12.1: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
strapi-app  | warning strapi-admin > webpack-dev-server > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
strapi-app  | warning strapi-admin > webpack-dev-server > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
strapi-app  | warning strapi-admin > @babel/polyfill > core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
strapi-app  | warning strapi-admin > react-intl > @formatjs/intl-unified-numberformat@3.3.7: We have renamed the package to @formatjs/intl-numberformat
strapi-app  | warning strapi-admin > react-intl > intl-messageformat-parser@5.5.1: backwards incompatible, please upgrade to 6.0 instead
strapi-app  | warning strapi-admin > react-intl > intl-messageformat > intl-messageformat-parser@5.5.1: backwards incompatible, please upgrade to 6.0 instead
strapi-app  | warning strapi-admin > reactstrap > react-popper > popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
strapi-app  | warning strapi-admin > webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
strapi-app  | warning strapi-admin > webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
strapi-app  | warning strapi-admin > webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
strapi-app  | warning strapi-plugin-users-permissions > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
strapi-app  | warning strapi-plugin-users-permissions > request > har-validator@5.1.5: this library is no longer supported
strapi-app  | warning strapi-plugin-email > strapi-provider-email-sendmail > sendmail > mailcomposer@3.12.0: This project is unmaintained
strapi-app  | warning strapi-plugin-email > strapi-provider-email-sendmail > sendmail > mailcomposer > buildmail@3.10.0: This project is unmaintained
strapi-app  | warning knex > debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
strapi-app  | warning url-loader@1.1.2: Invalid bin field for "url-loader".
strapi-app  | error An unexpected error occurred: "https://registry.yarnpkg.com/date-fns/-/date-fns-2.17.0.tgz: ESOCKETTIMEDOUT".
strapi-app  |
strapi-app  |  Keep trying!
strapi-app  |
strapi-app  | Oh, it seems that you encountered errors while installing dependencies in your project.
strapi-app  | Don't give up, your project was created correctly.
strapi-app  | Fix the issues mentioned in the installation errors and try to run the following command:
strapi-app  |
strapi-app  | cd /srv/app && yarn install
strapi-app  |
strapi-app exited with code 1
alexandrebodin commented 3 years ago

Hi, the log shows a yarn timeout. it is not a pbl with strapi you should be able to run the yarn install again to fix this

hbakhtiyor commented 3 years ago

i several times remove the container and up again, the same result

alexandrebodin commented 3 years ago

Sorry but this clearly is an issue with network timeouts. Not sure how we can help you here :/ Would you mind trying to use a custom Dockerfile like in the examples to test if the yarn install step works ?

hbakhtiyor commented 3 years ago

every time, network timeout issue with the same node module?! ))

nonameolsson commented 3 years ago

This happens to me as well. Followed instructions on how to build the docker image, and each time I get this error. If I stop the containers, cd in to the app-directory and install dependencies, then the error goes away.

Feels like something is wrong though.

greece57 commented 3 years ago

@hbakhtiyor @nonameolsson same issue here - did you resolve it somehow?