Hi, I m trying to access my dockerize app which is following micro service architecture. In my local machine i can access the app on different ports but in the digital ocean droplet i am unable to acess the app. Here is docker-File and docker-compose file configurations. I have 3 services all service having same dockerfile
# pull official base image
FROM node:13.12.0-alpine
# set working directory
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# install app dependencies
RUN apk add --no-cache git
COPY package.json ./
COPY package-lock.json ./
RUN npm ci
# add app
COPY . ./
# start app
CMD ["npm", "start"]
Here is the main docker-compose file
version: "2.0"
services:
mfe-host:
build:
context: ./host
ports:
- "3000:3000"
container_name: mfe-host
stdin_open: true
mfe-nav:
build:
context: ./nav
ports:
- "3001:3001"
container_name: mfe-nav
stdin_open: true
mfe-store:
build:
context: ./store
ports:
- "3002:3002"
container_name: mmfe-store
stdin_open: true
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
This comment has been deleted
Heya @kainatnazwalrus,
Make sure you have allowed those ports in your firewall. Whether you are using a firewall on your Droplet like
ufw
or a DigitalOcean Cloud Firewall, or both, you need to allow the ports your App will use.Hope that helps!