‘Webpack Module Not Found’ on pre-built docker image

I have a 3 docker images for a functioning website deployed on AWS. I have been recently asked to deploy this on new location and do some modifications to the frontend. However, this site hasn’t been supported or modified since 2020, which means that is a number of security updates and refactoring that needs to go into it.

To give the client some version of the site that they can play with, we decided to provide the currently deployed tool, but there is a catch: The client does not have an cloud infrastructure. To solve for that, we tested providing docker images to them along-side a docker compose script to deploy the application. The tests that we did worked well for some images, however I’m stuck with the frontend piece.

If I try to re-build the image, I end up with a blank website completely non-functional which I know is going to take a lot of time to solve. So, I extracted the image from AWS, but I get the error in the title when trying to deploy it.

For me its very weird, because I assume in a Kubernetes application such as this one you would need to consistently re-deploy the images as needed, and as such we should have any errors when trying to replicate the docker compose script.

Below is a complete traceback of the error, and the docker compose script. Would you know why this issue is happening and how to fix it?

Error traceback for the application

Docker Compose script:

version: '3.7'

volumes:
  mongo_data:


services:
  app-reload:
    image: stb-frontend:production-latest
    command: bash -c "npm run start:server"
    env_file: ./.env
    ports:
      - '9001:9001' # nodejs
      - '5858:5858' # nodejs debug
    volumes:
      - ./server:/home/node/app/server
      - ./client:/home/node/app/client
      - ./shared:/home/node/app/shared
      - ./config:/home/node/app/config
    depends_on:
      - app-client-reload
      - mongo
    networks:
      - db
      - python

  app-client-reload:
    image: stb-frontend:production-latest
    command: bash -c "npm run start:client"
    env_file: ./.env
    ports:
      - '9000:9000'
    volumes:
      - ./server:/home/node/app/server
      - ./client:/home/node/app/client
      - ./shared:/home/node/app/shared
      - ./config:/home/node/app/config
    healthcheck:
      test: ['CMD', 'curl', '-f', 'http://localhost:9000']
      interval: 30s
      timeout: 10s
      retries: 20
    networks:
      - db

  app:
    image: stb-frontend:production-latest
    command: bash -c "npm run start:server"
    env_file: ./.env
    ports:
      - '9001:9001' # nodejs
      - '5858:5858' # nodejs debug
    depends_on:
      - app-client
      - mongo
    networks:
      - db

  app-client:
    image: stb-frontend:production-latest
    command: bash -c "npm run start:client"
    env_file: ./.env
    ports:
      - '9000:9000' # webpack-dev-server port
    healthcheck:
      test: ['CMD', 'curl', '-f', 'http://localhost:9000']
      interval: 30s
      timeout: 10s
      retries: 20
    networks:
      - db

  mongo:
    image: stb-mongo:production-latest
    command: mongod --port 27017
    ports:
      - '27017:27017'
    volumes:
      - type: volume
        source: mongo_data
        target: /data/db
    networks:
      - db