Hi I have 3 containers running from the same image but different start command.
I can only access two on the browser but I can’t access the main app on the browser
Note: I entered into the container and used curl to access the app. It returned the hello word, which means the container is running
This is the docker file below, I exposed the three ports. The can access the second and third port on the browser but not the first one.
FROM node:19-bullseye
# ARG NODE_ENV=production
# ENV NODE_ENV $NODE_ENV
USER node
WORKDIR /app
COPY --chown=node:node package*.json ./
RUN npm ci && npm cache clean --force
# ENV PATH /opt/node_app/node_modules/.bin:$PATH
COPY --chown=node:node . .
RUN npm run build
EXPOSE 6000
EXPOSE 3001
EXPOSE 3002
CMD ["nest", "start"]
Below is the compose file
app:
image: vickysomtee/schoolable
command: node dist/src/main.js
ports:
- 6000:6000
environment:
<<: [*default-environment]
deploy:
replicas: 1
volumes:
- ./:/app
- /app/node_modules
networks:
- traefik_public
worker:
image: vickysomtee/schoolable
command: node dist/src/worker.js
ports:
- 3001:3001
environment:
<<: [*default-environment]
deploy:
replicas: 1
volumes:
- ./:/app
- /app/node_modules
networks:
- traefik_public
lqueue:
image: vickysomtee/schoolable
command: node dist/src/ledger-queue.js
ports:
- 3002:3002
environment:
<<: [*default-environment]
deploy:
replicas: 1
volumes:
- ./:/app
- /app/node_modules
networks:
- traefik_public