Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Node v14 not found #299

Open
tw1t611 opened this issue Jun 10, 2021 · 1 comment
Open

Node v14 not found #299

tw1t611 opened this issue Jun 10, 2021 · 1 comment

Comments

@tw1t611
Copy link

tw1t611 commented Jun 10, 2021

I tried to use strapi with node v14. I need the newer version of Intl. api.

docker-compoes.yml:

image: strapi/strapi:3.6.3-node14

error:

ERROR: manifest for strapi/strapi:3.6.3-node14 not found: manifest unknown: manifest unknown

strapi/strapi:latest should be the same and was found, but comes with node v12, which does not come with full-icu.

@tw1t611
Copy link
Author

tw1t611 commented Jun 24, 2021

For anyone else who needs the update, create these files in strapi folder.

Dockerfile:

FROM node:14

RUN yarn global add strapi

RUN mkdir /srv/app && chown 1000:1000 -R /srv/app
WORKDIR /srv/app

COPY . .
RUN yarn
RUN yarn add sharp

ENTRYPOINT ["docker-entrypoint.sh"]

EXPOSE 1337

CMD ["strapi", "develop"]

docker-entrypoint.sh:

#!/bin/sh
set -ea

if [ "$1" = "strapi" ]; then

  if [ ! -f "package.json" ]; then

    DATABASE_CLIENT=${DATABASE_CLIENT:-sqlite}

    EXTRA_ARGS=${EXTRA_ARGS}

    echo "Using strapi $(strapi version)"
    echo "No project found at /srv/app. Creating a new strapi project"

    DOCKER=true strapi new . \
      --dbclient=$DATABASE_CLIENT \
      --dbhost=$DATABASE_HOST \
      --dbport=$DATABASE_PORT \
      --dbname=$DATABASE_NAME \
      --dbusername=$DATABASE_USERNAME \
      --dbpassword=$DATABASE_PASSWORD \
      --dbssl=$DATABASE_SSL \
      $EXTRA_ARGS

  elif [ ! -d "node_modules" ] || [ ! "$(ls -qAL node_modules 2>/dev/null)" ]; then

    echo "Node modules not installed. Installing..."

    if [ -f "yarn.lock" ]; then

      yarn install

    else

      npm install

    fi

  fi

fi

echo "Starting your app..."

exec "$@"

.dockerignore:

node_modules
npm-debug.log
Dockerfile
.dockerignore
.git
.gitignore
.strapi-updater.json
build
.cach

Run

docker build -t strapi-dev .

and add strapi-dev to your docker-compose.yml

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant