I've a nodejs container which hosts my backend and I have a nginx container which is hosting my Angular.
They are both working fine. I'm able to visit my nodeJS container and I'm able to visit my Nginx-container.
The problem is there seems to be no connection between the containers. The nginx container is only hosting the /dist folder which contains the angular but nothing from the NodeJS.
Do you have to edit the /etc/nginx/nginx.conf
or the --link
command for this?
I read somewhere that your nodejs and nginx would bind automatically.
My backend is running on 8888, frontend on 8080.
nginx dockerfile (The npm install etc are already performed in jenkins)
FROM nginx
COPY dist /usr/share/nginx/html/dist
FROM node
Nodejs dockerfile
RUN mkdir -p /usr/src/test
WORKDIR /usr/src/test
COPY node_modules /usr/src/test/
COPY server.js /usr/src/test/
EXPOSE 8080
CMD [ "node", "server.js" ]
I start them by performing:
docker run -d -p 80:80 --name "app" localhost:5000/test/nginx-image:1
docker run -d -p 8888:8888 --name "app-" localhost:5000/test/nodejs-image:1