A
A
Alexander Bondarenko2021-12-03 19:33:40
Node.js
Alexander Bondarenko, 2021-12-03 19:33:40

Why errors in docker container with react?

Please tell me how to properly set up the project in docker on react, everything works successfully on the local version, after a clone from git, everything works successfully on the local machine, errors on the docker, first it cannot find the file, then errors like Unhandled Rejection (TypeError): is not a function, although the same function works successfully on the locale.
docker-compose:

version: '3.8'

services:

  frontend:
    container_name: my-react
    build: .
    ports:
      - 3000:3000
    stdin_open: true
    env_file:
      - .env
    command: npm start


docker
FROM node:14.17
 
WORKDIR /
 
COPY package*.json ./
 
RUN npm install
 
COPY . .
 
EXPOSE 3000
 
CMD [ "npm", "start" ]

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question