strapi / strapi-docker

Install and run your first Strapi project using Docker

Home Page:https://strapi.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Azure Docker Compose Strapi/Strapi container - List of failed dependancies on deployment

j4t1nd3r opened this issue · comments

Bug report

Describe the bug

I followed this guide: https://strapi.io/blog/how-to-run-a-strapi-dev-stack-with-docker-compose
Shifting from local to cloud:
deploying strapi/strapi + mongo on Azure, strapi/strapi has a multitude of errors + takes 50 mins to roughly get through dependancies where on my local machine container is deployed in 5 mins.

Steps to reproduce the behavior

  1. docker compose up
  2. See error in logs

Expected behavior

No dependancy errors / dependancies installed faster than 50 mins

Screenshots

Container stack deployed locally:
local
Deployed in Cloud:
cloud

Code snippets

docker-compose.yml:

version: "3.8"

services:
  dido_strapi:
    image: strapi/strapi
    container_name: didostrapi
    restart: unless-stopped
    env_file: .env
    environment:
      DATABASE_CLIENT: ${DATABASE_CLIENT}
      DATABASE_NAME: ${DATABASE_NAME}
      DATABASE_HOST: ${DATABASE_HOST}
      DATABASE_PORT: ${DATABASE_PORT}
      DATABASE_USERNAME: ${DATABASE_USERNAME}
      DATABASE_PASSWORD: ${DATABASE_PASSWORD}
    networks:
      - strapi-app-network
    volumes:
      - app:/srv/app  
    ports:
      - "1337:1337"

  dido_mongo:
    image: mongo
    container_name: didomongo
    restart: unless-stopped
    env_file: .env
    environment:
      MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
      MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
    networks:
      - strapi-app-network
    volumes:
      - strapidata:/data/db/
    ports:
      - "27017:27017"
networks:
  strapi-app-network:
    driver: bridge

volumes:
  strapidata:
    driver: azure_file
    driver_opts:
      share_name: strapidata
      storage_account_name: didostorage
  app:
    driver: azure_file
    driver_opts:
      share_name: strapidata
      storage_account_name: didostorage

Azure / Docker commands ran

# creation of resources
New-AzResourceGroup     -name $rgname -location $location
New-AzContainerRegistry -ResourceGroupName $rgname -name $acrname -sku Basic -EnableAdminUser
New-AzStorageAccount    -ResourceGroupName $rgname -Name $storgname -Location $location -SkuName Standard_LRS
# new resources as variables
$rg         = Get-AzResourceGroup     -name $rgname
$reg        = Get-AzContainerRegistry -ResourceGroupName $rgname -name $acrname
$storgaccnt = Get-AzStorageAccount    -ResourceGroupName $rgname -Name $storgname
# login to az container
$creds = Get-AzContainerRegistryCredential -ResourceGroupName $rgname -name $acrname
$creds.Password | docker login $reg.LoginServer -u $creds.Username --password-stdin

# # Docker
docker context use default
docker pull strapi/strapi
docker pull mongo
# tag docker images
docker tag strapi/strapi didocontreg.azurecr.io/didostrapi
docker tag mongo didocontreg.azurecr.io/didomongo
# push docker images
docker push didocontreg.azurecr.io/didomongo
docker push didocontreg.azurecr.io/didostrapi
# check acr repo for images
az acr repository show -n $acrname --repository didostrapi
az acr repository show -n $acrname --repository didomongo
# docker / azure login setup
 # az context
docker context create aci az_dido --resource-group dido-poc
docker context use az_dido
# create docker volumes
docker volume create app --storage-account $storgname
docker volume create strapidata --storage-account $storgname

# run container instance
docker compose --project-name $continst 

System

  • Node.js version: 12.20.1
  • NPM version: 6.14.10
  • Strapi version: 3.4.6
  • Database: Mongo
  • Operating system: Alpine (docker container)

Additional context

Add any other context about the problem here.

I have increased CPU/Ram to the following:
Strapi container: 2 CPU 4Gb Ram
Mongo Container: 1.9 CPU 3Gb Ram
Storage Account SKU switched from Basic to Standard
 
Strapi container installation of dependencies still take an hour and still have multiple failures.
Locally I am using "Docker-Compose", on Azure I am using "Docker Compose" command.

Strapi container Logs:
docker logs -f didopoc_didostrapi

Using strapi 3.4.6
No project found at /srv/app. Creating a new strapi project
Creating a new Strapi application at /srv/app.

Creating a project from the database CLI arguments.        
Creating files.
- Installing dependencies:
Error while installing dependencies:
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.
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)
warning strapi > chokidar > fsevents@2.1.3: "Please update to latest v2.3 or v2.2"
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.
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.
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.
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.
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.warning strapi-admin > react-intl > intl-messageformat-parser@5.5.1: backwards incompatible, please upgrade to 6.0 instead
warning strapi-admin > react-intl > intl-messageformat > intl-messageformat-parser@5.5.1: backwards incompatible, please upgrade to 6.0 instead
Starting your app...n-users-permissions > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning strapi-plugin-users-permissions > request > har-validator@5.1.5: this library is no longer supported
warning strapi-plugin-email > strapi-provider-email-sendmail > sendmail > mailcomposer@3.12.0: This project is unmaintained
warning strapi-plugin-email > strapi-provider-email-sendmail > sendmail > mailcomposer > buildmail@3.10.0: This project is unmaintained
warning url-loader@1.1.2: Invalid bin field for "url-loader".
warning "strapi-admin > bootstrap@4.6.0" has unmet peer dependency "jquery@1.9.1 - 3".
warning "strapi-admin > bootstrap@4.6.0" has unmet peer dependency "popper.js@^1.16.1".
warning "strapi-plugin-users-permissions > grant-koa@5.4.8" has unmet peer dependency "koa@>=2.0.0".
error An unexpected error occurred: "ENOTSUP: operation not supported on socket, symlink '../../../parser/bin/babel-parser.js' -> '/srv/app/node_modules/@babel/core/node_modules/.bin/parser'".

 Keep trying!

Oh, it seems that you encountered errors while installing dependencies in your project.
Don't give up, your project was created correctly.
Fix the issues mentioned in the installation errors and try to run the following command:

cd /srv/app && yarn install

docker exec -it didopoc_didostrapi /bin/bash
cd /srv/app && yarn install

yarn install v1.22.5
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
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.
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)
warning strapi > chokidar > fsevents@2.1.3: "Please update to latest v2.3 or v2.2"
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.
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.
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.
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.
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.
warning strapi-admin > react-intl > intl-messageformat-parser@5.5.1: backwards incompatible, please upgrade to 6.0 instead
warning strapi-admin > react-intl > intl-messageformat > intl-messageformat-parser@5.5.1: backwards incompatible, please upgrade to 6.0 instead
warning strapi-admin > react-intl > @formatjs/intl-unified-numberformat@3.3.7: We have renamed the package to @formatjs/intl-numberformat
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
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.
warning strapi-admin > webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning strapi-admin > webpack-dev-server > chokidar > braces > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning strapi-plugin-users-permissions > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning strapi-plugin-users-permissions > request > har-validator@5.1.5: this library is no longer supported
warning strapi-plugin-email > strapi-provider-email-sendmail > sendmail > mailcomposer@3.12.0: This project is unmaintained
warning strapi-plugin-email > strapi-provider-email-sendmail > sendmail > mailcomposer > buildmail@3.10.0: This project is unmaintained
[3/5] Fetching packages...
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "strapi-admin > bootstrap@4.6.0" has unmet peer dependency "jquery@1.9.1 - 3".
warning "strapi-admin > bootstrap@4.6.0" has unmet peer dependency "popper.js@^1.16.1".
warning "strapi-plugin-users-permissions > grant-koa@5.4.8" has unmet peer dependency "koa@>=2.0.0".
[----------------------------------------------------------------------] 0/1496

Never moves past 0/1496, connection to container drops as I figure container reboots.

Moving this to the docker repo