Home > Back-end >  This page isn’t working localhost didn’t send any data. ERR_EMPTY_RESPONSE
This page isn’t working localhost didn’t send any data. ERR_EMPTY_RESPONSE

Time:06-02

I have a problem. when try to run my dockerFile in React app. When I try to run my DockerFile

FROM node:16

ENV REACT_APP_baseUrl = https://localhost:44377/api
ENV REACT_APP_baseUrlFile = https://localhost:3000/files
ENV REACT_APP_baseUrlFileMetadata = https://localhost:3000/files/metaData
ENV REACT_APP_FILESTORAGE_KEY = ./fileStorage.key
ENV REACT_APP_FILESTORAGE_PEM = ./fileStorage.pem
ENV REACT_APP_ROOT_CA = ./rootCA.pem
ENV REACT_APP_baseUrlReact = http://localhost:8080

WORKDIR /app-ui

COPY package.json ./
COPY yarn.lock ./
COPY package-lock.json ./
COPY ./ ./
RUN yarn install
EXPOSE 8080
CMD ["yarn", "start"]

Then I run:

docker build -f Dockerfile -t client .
docker run -it -p 8080:8080 client

And get

error page

But I do not understand the problem. Please help

I can provide container status enter image description here

CodePudding user response:

You did not specify the that CRA should use for the development server. You can do so with the -e as such:

docker run -it -p 8080:8080 -e "PORT=8080" client
  • Related