1

First time docker user.. Please help out! Much appreciated!

I am getting

server_1  |     at Function.Module._resolveFilename (module.js:547:15)
server_1  |     at Function.Module._load (module.js:474:25)
server_1  |     at Module.require (module.js:596:17)
server_1  |     at require (internal/module.js:11:18)
server_1  |     at Object.<anonymous> (/api/src/workers/ContentWorker.js:3:17)

when my api is running in docker, but it runs perfectly in my local environment.

I was trying to see the image file structure, but it looks good.

Here is my dockerfile:

FROM mhart/alpine-node:8.11.4
WORKDIR /api
COPY package*.json /api/
RUN npm install
COPY server.js /api
COPY ./src /api/src
EXPOSE 5000
CMD ["node", "server.js"]

docker-compose:

version: "3"

services:
  server:
    build: .
    expose:
      - 5000
    environment:
      - PORT=5000
      - NODE_ENV=development
    ports:
      - 5000:5000

  client:
    build: ./client
    environment:
      - REACT_APP_PORT=3000
      - CHOKIDAR_USEPOLLING=true
    expose:
      - 3000
    ports:
      - 3000:3000
    links:
      - server

File structure:enter image description here

qrb
  • 89
  • 3
  • Would https://stackoverflow.com/q/42040317/6309 or https://stackoverflow.com/q/30043872/6309 help? – VonC Sep 29 '19 at 05:15
  • try to build image `docker build --no-cache you_image .` or show your docker-compose – Adiii Sep 29 '19 at 05:37
  • stackoverflow.com/q/42040317/6309 or stackoverflow.com/q/30043872/6309 those won't help as I am not missing dependency towards any library. – qrb Sep 30 '19 at 00:19

1 Answers1

0

Looks like a casing issue. Since linux file system is case sensitive, it will not work under docker's environment.

qrb
  • 89
  • 3