FROM node:20-alpine as build
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev git > /dev/null 2>&1

WORKDIR /opt/app

COPY package.json yarn.lock ./
COPY src/plugins/ src/plugins/

RUN yarn global add node-gyp
RUN yarn config set network-timeout 600000 -g && yarn install

COPY src/ src/
COPY public/ public/
COPY database/ database/
COPY config/ config/
COPY tsconfig.json ./
COPY favicon.png ./
COPY tsconfig.json ./

RUN yarn --cwd src/plugins/fdc-duplicate build
RUN yarn --cwd src/plugins/fdc-material-symbols build

RUN yarn build

FROM node:20-alpine
RUN apk add --no-cache vips-dev

WORKDIR /opt/app

COPY --from=build /opt/app ./
COPY docker/entrypoint.sh ./
COPY docker/healthcheck.js ./

RUN chmod +x entrypoint.sh

EXPOSE 1337
ENTRYPOINT ["./entrypoint.sh"]


{
  "version": "0.0.0",
  "keywords": [],
  "type": "commonjs",
  "exports": {
    "./package.json": "./package.json",
    "./strapi-admin": {
      "source": "./admin/src/index.js",
      "import": "./dist/admin/index.mjs",
      "require": "./dist/admin/index.js",
      "default": "./dist/admin/index.js"
    },
    "./strapi-server": {
      "source": "./server/src/index.js",
      "import": "./dist/server/index.mjs",
      "require": "./dist/server/index.js",
      "default": "./dist/server/index.js"
    }
  },
  "files": [
    "dist"
  ],
  "scripts": {
    "build": "strapi-plugin build",
    "watch": "strapi-plugin watch",
    "watch:link": "strapi-plugin watch:link",
    "verify": "strapi-plugin verify"
  },
  "dependencies": {
    "@strapi/design-system": "^2.0.0-rc.23",
    "@strapi/icons": "^2.0.0-rc.22",
    "react-intl": "^6.6.2"
  },
  "peerDependencies": {
    "@strapi/strapi": "^5.17.0",
    "@strapi/sdk-plugin": "^5.3.2",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-router-dom": "^6.30.1",
    "styled-components": "^6.1.19"
  },
  "strapi": {
    "kind": "plugin",
    "name": "fdc-duplicate",
    "displayName": "FDC Duplicate Button",
    "description": "Satrpi plugin for creating duplicate of entries"
  },
  "name": "fdc-duplicate",
  "description": "Satrpi plugin for creating duplicate of entries",
  "license": "MIT",
  "author": "tetiana"
}


 => [strapi build 12/17] COPY tsconfig.json ./                                                                                                                                               0.1s 
 => [strapi build 13/17] COPY favicon.png ./                                                                                                                                                 0.1s 
 => [strapi build 14/17] COPY tsconfig.json ./                                                                                                                                               0.1s 
 => ERROR [strapi build 15/17] RUN yarn --cwd src/plugins/fdc-duplicate build                                                                                                                0.6s 
------
 > [strapi build 15/17] RUN yarn --cwd src/plugins/fdc-duplicate build:
0.470 yarn run v1.22.22
0.509 $ strapi-plugin build
0.521 /bin/sh: strapi-plugin: not found
0.529 error Command failed with exit code 127.
0.530 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
failed to solve: process "/bin/sh -c yarn --cwd src/plugins/fdc-duplicate build" did not complete successfully: exit code: 127