I want to run a simple React application inside Docker. It runs well outside but when I try to run it from docker, I get the following errors and at the moment I have no clue.
custportal_1 | yarn run v1.15.2
custportal_1 | $ react-scripts start
custportal_1 | ℹ 「wds」: Project is running at http://172.24.0.12/
custportal_1 | ℹ 「wds」: webpack output is served from
custportal_1 | ℹ 「wds」: Content not from webpack is served from /usr/src/app/public
custportal_1 | ℹ 「wds」: 404s will fallback to /
custportal_1 | Starting the development server...
custportal_1 |
custportal_1 | Done in 2.61s.
custportal_1 exited with code 0
The application is created by create-react-app command. My Dockerfile configuration is
FROM node:11 as build-deps
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn
COPY . ./
RUN yarn build
Again the application runs well outside but breaks when called inside Docker. In docker-compose I call the container with
command: bash -c "export PORT=8081 && yarn start"
** I have nginx reverse proxy running on the background.