Skip to content
TheChatArchiveThe Chat Archive
grok-3-preview-02-24· xAIHugging Face LMArena Human Preference 140K

FROM node:20-alpine as build RUN apk update && apk add --no-cache build-base gcc…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Geminigemini-2.5-flash-preview-04-17’s answer.
  1. User

    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

  2. Assistant

    The error in your Dockerfile build process indicates that the strapi-plugin command is not found when running yarn --cwd src/plugins/fdc-duplicate build. This is happening because the strapi-plugin CLI tool, which is required to build Strapi plugins, is not installed in your build environment. Let's analyze the issue and provide a solution.

    Root Cause

    The error message /bin/sh: strapi-plugin: not found suggests that the strapi-plugin package (or a similar dependency) is not available in the environment. This is likely because:

    1. Missing Dependency: The strapi-plugin CLI tool is not installed globally or as a dependency in your project.
    2. Incorrect Build Command: The strapi-plugin build command might not be the correct way to build your plugin, depending on your Strapi version and setup.
    3. Environment Issue: The build environment might not have the necessary tools or dependencies to execute the plugin build process.

    Solution

    To fix this issue, you need to ensure that the necessary tools and dependencies are available in your build environment. Below are the steps to resolve the issue:


    1. Install @strapi/cli or Required Tools

    The strapi-plugin command might not exist as a standalone package. Instead, Strapi plugins are typically built using the Strapi CLI or other tools provided by Strapi. You need to ensure that the @strapi/cli package (or equivalent) is installed globally in your build environment.

    Modify your Dockerfile to install the Strapi CLI globally:

    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 global add @strapi/cli  # Add this line to install Strapi CLI globally
    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"]
    

    2. Update Plugin Build Command

    The strapi-plugin build command in your plugin's package.json might not be correct. Based on the Strapi documentation, plugins are typically built using the Strapi CLI or by running a custom build script. Check the scripts section of your plugin's package.json (provided in your question):

    "scripts": {
      "build": "strapi-plugin build",
      "watch": "strapi-plugin watch",
      "watch:link": "strapi-plugin watch:link",
      "verify": "strapi-plugin verify"
    }
    

    The strapi-plugin build command is not a standard Strapi command. Instead, Strapi plugins are usually built using a custom build process (e.g., using tsc for TypeScript or babel for JavaScript). You need to ensure that the build script in your plugin's package.json is correctly set up to build the plugin.

    For example, if your plugin uses TypeScript, the build script might look like this:

    "scripts": {
      "build": "tsc -p tsconfig.json",
      "watch": "tsc -w",
      "watch:link": "strapi-plugin watch:link",
      "verify": "strapi-plugin verify"
    }
    

    If your plugin uses JavaScript, you might need to use a tool like babel or webpack to transpile and bundle the code. Update the build script accordingly.

    3. Ensure Plugin Dependencies Are Installed

    Your plugin's package.json lists several dependencies and peer dependencies. Ensure that these are installed in the build environment. When you run yarn install in the root of your project, it might not automatically install the dependencies for the plugins in src/plugins/. You need to explicitly install the dependencies for each plugin.

    Modify your Dockerfile to install the plugin dependencies before building:

    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 global add @strapi/cli
    RUN yarn config set network-timeout 600000 -g && yarn install
    
    # Install dependencies for each plugin
    RUN yarn --cwd src/plugins/fdc-duplicate install
    RUN yarn --cwd src/plugins/fdc-material-symbols 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"]
    

    4. Verify Plugin Build Process

    Before running the Docker build, test the plugin build process locally to ensure it works. Navigate to the plugin directory (src/plugins/fdc-duplicate) and run:

    yarn install
    yarn build
    

    If the build fails locally, it indicates an issue with the plugin's package.json or build configuration. Fix any errors before proceeding with the Docker build.

    5. Debugging Tips

    If the issue persists, here are some debugging tips:

    • Check Installed Packages: Add a step in your Dockerfile to list globally installed Yarn packages to verify that @strapi/cli is installed:
      RUN yarn global list
      
    • Check Plugin Build Output: Add a step to print the contents of the plugin directory before building to ensure all files are present:
      RUN ls -la src/plugins/fdc-duplicate
      
    • Verbose Build Output: Run the build command with verbose output to get more details:
      RUN yarn --cwd src/plugins/fdc-duplicate build --verbose
      

    6. Alternative Build Approach

    If the plugin build process is still failing, consider building the plugins as part of the main yarn build command for your Strapi application. Strapi's build process typically includes building all plugins automatically. In this case, you can remove the explicit plugin build steps from your Dockerfile:

    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 global add @strapi/cli
    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 ./
    
    # Build the entire Strapi application (including plugins)
    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"]
    

    This approach relies on Strapi's built-in build process to handle plugin compilation, which is often more reliable.


    Final Notes

    • Strapi Version Compatibility: Ensure that the versions of @strapi/strapi, @strapi/cli, and other dependencies in your project are compatible with each other. Check the Strapi documentation for version compatibility.
    • Plugin Development: If you are developing the fdc-duplicate plugin, consider following the official Strapi plugin development guide to ensure your plugin is structured correctly.
    • Docker Build Cache: If you make changes to your Dockerfile, ensure you rebuild the Docker image without using the cache to apply the changes:
      docker build --no-cache -t your-image-name .
      

    By following the steps above, you should be able to resolve the strapi-plugin: not found error and successfully build your Strapi application with plugins in Docker.

  3. User

    ✖ Building admin panel 7.799 [ERROR] There seems to be an unexpected error, try again with --debug for more information 7.799 7.803 ┌──────────────────────────────────────────────────────────────────────────────┐│ ││ Could not resolve ││ "../../src/plugins/fdc-duplicate/./dist/admin/index.mjs" from ││ ".strapi/client/app.js"
    ││ file: /opt/app/.strapi/client/app.js ││ at getRollupError ││ (file:/// opt/app/node_modules/rollup/dist/es/shared/parseAst.js:397:41) ││ at error ││ (file:///opt/app/node_modules/rollup/dist/es/shared/parseAst.js:393:42) ││ at ModuleLoader.handleInvalidResolvedId (file:///opt/app/node_modules/ro ││ llup/dist/es/shared/node-entry.js:21167:24)
    ││ at file:///opt/app/node_modules/rollup/dist/es/shared/node-entry.js:2112 ││ 7:26 ││
    │└──────────────────────────────────────────────────────────────────────────────┘ 7.860 error Command failed with exit code 1.

  4. Assistant

    The error you're encountering during the Strapi admin panel build process indicates that Rollup (the bundler used by Strapi to build the admin panel) is unable to resolve the index.mjs file for your fdc-duplicate plugin. This is a common issue when building Strapi plugins, especially if the plugin's build process or file structure is not set up correctly. Let's analyze the issue and provide a step-by-step solution.


    Root Cause

    The error message:

    Could not resolve "../../src/plugins/fdc-duplicate/./dist/admin/index.mjs" from ".strapi/client/app.js"
    

    suggests the following issues:

    1. Missing or Incorrect Plugin Build Output:

      • Strapi expects the fdc-duplicate plugin to have a built index.mjs file in the dist/admin/ directory of the plugin. This file is typically generated during the plugin's build process.
      • If the plugin's build process is not correctly set up, the dist/admin/index.mjs file will not exist, causing the admin panel build to fail.
    2. Incorrect Plugin exports Configuration:

      • The exports field in your plugin's package.json specifies where Strapi should look for the plugin's admin code (./dist/admin/index.mjs). If this path does not match the actual build output, the build will fail.
    3. Plugin Build Process Not Running:

      • The plugin's build process (e.g., yarn build in the plugin directory) might not be running correctly, or it might not be generating the expected output.
    4. File Structure Mismatch:

      • The file structure of your plugin might not match Strapi's expectations for a plugin, particularly in terms of where the admin code is located and how it is built.

    Solution

    To resolve this issue, you need to ensure that the fdc-duplicate plugin is correctly structured, its build process is working, and the expected build output (dist/admin/index.mjs) is generated. Below are the steps to fix the issue:


    1. Verify Plugin File Structure

    Strapi plugins have a specific file structure, especially for the admin panel code. Ensure your fdc-duplicate plugin (located in src/plugins/fdc-duplicate/) has the following structure:

    src/plugins/fdc-duplicate/
    ├── admin/
    │   └── src/
    │       └── index.js  # Entry point for admin panel code
    ├── package.json      # Plugin's package.json
    ├── tsconfig.json     # (Optional) If using TypeScript
    └── ...               # Other plugin files (e.g., server code)
    
    • The admin/src/index.js file is the entry point for the admin panel code of your plugin. This file is required for Strapi to load your plugin into the admin panel.
    • During the build process, this file should be transpiled and bundled into dist/admin/index.mjs.

    If your plugin is using TypeScript, the admin code might be in admin/src/index.ts instead of index.js. In this case, ensure you have a proper tsconfig.json file to handle TypeScript compilation.


    2. Update Plugin package.json

    Your plugin's package.json specifies how the plugin's admin code is exposed to Strapi via the exports field. Based on the error, Strapi is looking for dist/admin/index.mjs, but this file is not being generated.

    Here is the relevant part of your package.json:

    "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"
      }
    }
    
    • The strapi-admin export specifies that the admin panel code should be built into dist/admin/index.mjs (for ES modules) and dist/admin/index.js (for CommonJS).
    • Ensure that your plugin's build process generates these files in the dist/admin/ directory.

    If your plugin is not generating these files, the issue lies in the build process, which we will fix in the next step.


    3. Fix Plugin Build Process

    The error indicates that the dist/admin/index.mjs file is not being generated. This is likely because the plugin's build process is not set up correctly. Let's fix this by updating the scripts section of your plugin's package.json and ensuring the build process works.

    Step 3.1: Update scripts in package.json

    The scripts section of your plugin's package.json currently looks like this:

    "scripts": {
      "build": "strapi-plugin build",
      "watch": "strapi-plugin watch",
      "watch:link": "strapi-plugin watch:link",
      "verify": "strapi-plugin verify"
    }
    

    The strapi-plugin build command is not a standard Strapi command. Instead, you need to define a custom build process to transpile and bundle your plugin's admin code. Here’s how to fix it:

    • If your plugin uses JavaScript, you need to use a bundler like Rollup or Webpack to generate the dist/admin/index.mjs file.
    • If your plugin uses TypeScript, you need to use tsc (TypeScript compiler) to transpile the code.

    For simplicity, let's assume your plugin uses JavaScript. You can use Rollup to bundle the admin code. Update the scripts section as follows:

    "scripts": {
      "build": "rollup -c",
      "watch": "rollup -c -w",
      "watch:link": "strapi-plugin watch:link",
      "verify": "strapi-plugin verify"
    }
    

    Then, create a rollup.config.js file in the root of your plugin (src/plugins/fdc-duplicate/rollup.config.js) with the following content:

    import resolve from '@rollup/plugin-node-resolve';
    import commonjs from '@rollup/plugin-commonjs';
    import babel from '@rollup/plugin-babel';
    import terser from '@rollup/plugin-terser';
    
    export default [
      {
        input: 'admin/src/index.js', // Entry point for admin code
        output: [
          {
            file: 'dist/admin/index.mjs', // ES module output
            format: 'esm',
          },
          {
            file: 'dist/admin/index.js', // CommonJS output
            format: 'cjs',
          },
        ],
        plugins: [
          resolve(), // Resolve node_modules dependencies
          commonjs(), // Convert CommonJS modules to ES modules
          babel({ babelHelpers: 'bundled' }), // Transpile modern JavaScript
          terser(), // Minify the output
        ],
        external: [
          'react',
          'react-dom',
          'react-router-dom',
          'styled-components',
          '@strapi/design-system',
          '@strapi/icons',
          'react-intl',
        ], // Externalize peer dependencies
      },
    ];
    

    Next, install the required Rollup plugins as dev dependencies in your plugin:

    cd src/plugins/fdc-duplicate
    yarn add --dev @rollup/plugin-node-resolve @rollup/plugin-commonjs @rollup/plugin-babel @rollup/plugin-terser rollup
    

    Now, test the build process locally:

    cd src/plugins/fdc-duplicate
    yarn build
    

    After running this command, check if the dist/admin/index.mjs and dist/admin/index.js files are generated in the src/plugins/fdc-duplicate/dist/admin/ directory. If they are, the plugin build process is working correctly.

    Step 3.2: If Using TypeScript

    If your plugin uses TypeScript (e.g., admin/src/index.ts), update the scripts section to use tsc:

    "scripts": {
      "build": "tsc -p tsconfig.json",
      "watch": "tsc -w",
      "watch:link": "strapi-plugin watch:link",
      "verify": "strapi-plugin verify"
    }
    

    Ensure you have a tsconfig.json file in the root of your plugin (src/plugins/fdc-duplicate/tsconfig.json) with the following content:

    {
      "compilerOptions": {
        "target": "esnext",
        "module": "esnext",
        "outDir": "dist",
        "rootDir": ".",
        "strict": true,
        "esModuleInterop": true,
        "skipLibCheck": true,
        "forceConsistentCasingInFileNames": true,
        "moduleResolution": "node",
        "jsx": "react-jsx",
        "declaration": true
      },
      "include": ["admin/src/**/*", "server/src/**/*"],
      "exclude": ["node_modules", "dist"]
    }
    

    Install TypeScript as a dev dependency in your plugin:

    cd src/plugins/fdc-duplicate
    yarn add --dev typescript
    

    Test the build process locally:

    cd src/plugins/fdc-duplicate
    yarn build
    

    Check if the dist/admin/index.mjs file is generated. Note that TypeScript typically generates .js files, not .mjs. If Strapi requires .mjs, you may need to use Rollup (as shown in Step 3.1) to bundle the TypeScript output into .mjs format.


    4. Update Dockerfile

    Your Dockerfile runs the plugin build process explicitly for each plugin (yarn --cwd src/plugins/fdc-duplicate build). Ensure that the plugin's dependencies are installed and the build process is executed correctly. Update your Dockerfile to include the plugin build dependencies:

    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
    
    # Install dependencies for each plugin
    RUN yarn --cwd src/plugins/fdc-duplicate install
    RUN yarn --cwd src/plugins/fdc-material-symbols install
    
    COPY src/ src/
    COPY public/ public/
    COPY database/ database/
    COPY config/ config/
    COPY tsconfig.json ./
    COPY favicon.png ./
    COPY tsconfig.json ./
    
    # Build each plugin
    RUN yarn --cwd src/plugins/fdc-duplicate build
    RUN yarn --cwd src/plugins/fdc-material-symbols build
    
    # Build the entire Strapi application
    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"]
    

    If the plugin build process is working correctly locally, this Dockerfile should work without errors.


    5. Debugging Tips

    If the issue persists, here are some debugging tips to help identify the root cause:

    • Check Plugin Build Output: Add a step in your Dockerfile to list the contents of the plugin's dist/ directory after building the plugin:

      RUN yarn --cwd src/plugins/fdc-duplicate build
      RUN ls -la src/plugins/fdc-duplicate/dist/admin/
      

      This will help you verify if the index.mjs file is being generated.

    • Run Build with Debug Mode: The error message suggests running the build with --debug for more information. Modify the yarn build command in your Dockerfile to include the --debug flag:

      RUN yarn build --debug
      

      This will provide more detailed error messages.

    • Test Plugin Build Locally: Before running the Docker build, test the plugin build process locally to ensure it works:

      cd src/plugins/fdc-duplicate
      yarn install
      yarn build
      

      If the build fails locally, fix the issue before proceeding with the Docker build.

    • Check Strapi Version Compatibility: Ensure that the versions of @strapi/strapi, @strapi/design-system, and other dependencies in your project are compatible with each other. Check the Strapi documentation for version compatibility.

    • Verify Plugin Admin Code: Ensure that the admin/src/index.js (or index.ts) file exists and contains valid code. For example, a minimal index.js file for a Strapi plugin might look like this:

      export default {
        bootstrap(app) {
          console.log('FDC Duplicate plugin bootstrapped');
        },
      };
      

    6. Alternative Approach: Let Strapi Build Plugins

    If you are unable to fix the plugin build process, consider letting Strapi handle the plugin build as part of the main yarn build command. Strapi's build process typically includes building all plugins automatically. In this case, you can remove the explicit plugin build steps from your Dockerfile:

    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 ./
    
    # Build the entire Strapi application (including plugins)
    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"]
    

    This approach relies on Strapi's built-in build process to handle plugin compilation, which is often more reliable.


    Final Notes

    • Strapi Plugin Development Guide: If you are developing the fdc-duplicate plugin, consider following the official Strapi plugin development guide to ensure your plugin is structured correctly: Strapi Plugin Development.
    • Docker Build Cache: If you make changes to your Dockerfile or plugin code, ensure you rebuild the Docker image without using the cache to apply the changes:
      docker build --no-cache -t your-image-name .
      
    • Minimal Reproducible Example: If the issue persists, consider creating a minimal reproducible example of your plugin and sharing it (e.g., via GitHub) so that others can help debug the issue.

    By following the steps above, you should be able to resolve the Could not resolve "../../src/plugins/fdc-duplicate/./dist/admin/index.mjs" error and successfully build your Strapi application with plugins in Docker.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.