Docker file issue with localhost

Viewed 37

Im having group project. I've built bakckend and my friend dealt with front. Now I'm trying to deploy app. Everything works, but there is issue with front when working with containers. This is the Dockerfile:

#stage 1
FROM node:latest as node
WORKDIR /app
COPY . .
EXPOSE 4200
RUN npm install
RUN npm run build --prod
#stage 2
FROM nginx:alpine
COPY --from=node /app/dist/project-supporting-system-front-end /usr/share/nginx/html

The issue is that I'm getting "localhost didn’t send any data" error. And I'm pretty sure it has something to do with Dockerfile. I've seen posts where people were talking about changing the localhost to 0.0.0.0, but I dont know where to put it in the Dockerfile.

Docker-compose:

front:
    image: repository
    ports:
      - 4200:4200
0 Answers
Related