I’d like to add the strapi-plugin-bootstrap-admin-user plugin after Strapi has finished installing in Docker.
I’m trying to add it at the entrypoint since I suppose that Strapi should be done installing at that point.
docker-compose.yml:
version: "3.8"
services:
postgres:
image: postgres
environment:
POSTGRES_DB: strapi
POSTGRES_USER: strapi
POSTGRES_PASSWORD: strapi
volumes:
- ./data/postgres:/var/lib/postgresql/data
strapi:
image: strapi/strapi
environment:
DATABASE_CLIENT: postgres
DATABASE_NAME: strapi
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_USERNAME: strapi
DATABASE_PASSWORD: strapi
STRAPI_TELEMETRY_DISABLED: "True"
volumes:
- ./server/strapi/app:/srv/app
ports:
- '1337:1337'
depends_on:
- postgres
working_dir: '/srv/app'
entrypoint: bash -c 'npm install strapi-plugin-bootstrap-admin-user && /bin/sh /usr/local/bin/docker-entrypoint.sh'
Unfortunately I end up with an error:
strapi_1 | npm WARN saveError ENOENT: no such file or directory, open '/srv/app/package.json'
strapi_1 | npm notice created a lockfile as package-lock.json. You should commit this file.
strapi_1 | npm WARN enoent ENOENT: no such file or directory, open '/srv/app/package.json'
strapi_1 | npm WARN app No description
strapi_1 | npm WARN app No repository field.
strapi_1 | npm WARN app No README data
strapi_1 | npm WARN app No license field.
strapi_1 |
strapi_1 | + strapi-plugin-bootstrap-admin-user@1.0.8
strapi_1 | added 1 package from 1 contributor and audited 1 package in 1.405s
strapi_1 | found 0 vulnerabilities
strapi_1 |
strapi_1 | Starting your app...
docker-sveltekit_strapi_1 exited with code 0
Am I doing it wrong? Would it be better to create a Dockerfile?
Thanks!