By Kainat Naz
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!
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.
ufw allow PORTHERE
Hope that helps!
This comment has been deleted
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.