Hi everyone,
I have a container with port 8080 exposed and I use docker-compose to build and run this container.
But when I try to access on localhost:8080 on my web browser I can’t access to the service listening on this port.
This my configurations :
docker-compose :
version: '2'
services:
financial-tracker:
build: .
environment:
- APP_TOKEN=${APP_TOKEN}
- NODE_ENV=PROD
ports:
- "8080:8080"
Dockerfile :
FROM node:16.13.0-alpine
WORKDIR /usr/src/app
COPY package.json .
RUN npm install
COPY ./config ./config
COPY ./dist ./dist
EXPOSE 8080
CMD ["npm", "start"]
My application work perfectly outside any docker container, I can access to this on 8080 port.
I’ve also trying to find IP adress of container and access like this on web browser : 172.18.0.2:8080. But it doesn’t work…
I’ve used docker ps to see if my container has listening on port 8080 and it does.
6c684868b07a financialtracker_financial-tracker "docker-entrypoint.s…" 6 seconds ago Up 4 seconds 0.0.0.0:8080->8080/tcp financialtracker_financial-tracker_1
(Sorry for my approximative english…)
Thanks for the help.