hello guys, i'm new to traefik and i'm having a problem right now i already have a docker swarm cluster in an ec2 instance running and the app is running on port 3000 in the container. when i try to hit the app it says 502 bad gateway it seems that traefik doesn't found the port 3000 in the container for said service.
this is my docker compose
version: '3.3'
services:
be-ppi-hub-admin:
image: awsid.dkr.ecr.ap-southeast-1.amazonaws.com/be-ppi-hub-admin:latest-development
environment:
ALLOWED_ORIGINS: http://localhost:3000,http://localhost:3001
LOYALID_BASE_URL: https://portal-staging.loyal.id
SERVER_TYPE: development
TZ: Asia/Jakarta
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- traefik-public
logging:
driver: json-file
deploy:
labels:
traefik.http.routers.be-ppi-hub-admin-https.rule: Host(`apis.oreo.paintpro.co.id`)
&& PathPrefix(`/hub-admin`)
traefik.http.services.be-ppi-hub-admin.loadbalancer.server.port: '3000'
traefik.http.routers.be-ppi-hub-admin-http.middlewares: https-redirect
traefik.http.routers.be-ppi-hub-admin-http.rule: Host(`apis.oreo.paintpro.co.id`)
&& PathPrefix(`/hub-admin`)
traefik.http.routers.be-ppi-hub-admin-http.entrypoints: http
swarmpit.service.deployment.autoredeploy: 'true'
traefik.http.routers.be-ppi-hub-admin-https.entrypoints: https
traefik.constraint-label: traefik-public
traefik.http.routers.be-ppi-hub-admin-https.tls: 'true'
traefik.docker.network: traefik-public
traefik.enable: 'true'
traefik.http.routers.be-ppi-hub-admin-https.tls.certresolver: le
resources:
reservations:
cpus: '0.1'
memory: 100M
limits:
cpus: '0.5'
memory: 1024M
be-ppi-hub-loyalty:
image: awsid.dkr.ecr.ap-southeast-1.amazonaws.com/be-ppi-hub-loyalty:latest-development
environment:
ALLOWED_ORIGINS: http://localhost:3000,http://localhost:3001
LOYALID_BASE_URL: https://portal-staging.loyal.id
SERVER_TYPE: development
TZ: Asia/Jakarta
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- traefik-public
logging:
driver: json-file
deploy:
labels:
traefik.http.routers.be-ppi-hub-loyalty-https.tls.certresolver: le
traefik.http.routers.be-ppi-hub-loyalty-http.middlewares: https-redirect
traefik.http.routers.be-ppi-hub-loyalty-https.tls: 'true'
traefik.http.routers.be-ppi-hub-loyalty-https.entrypoints: https
traefik.http.services.be-ppi-hub-loyalty.loadbalancer.server.port: '3000'
traefik.http.routers.be-ppi-hub-loyalty-https.rule: Host(`apis.oreo.paintpro.co.id`)
&& PathPrefix(`/hub-loyalty`)
swarmpit.service.deployment.autoredeploy: 'true'
traefik.constraint-label: traefik-public
traefik.http.routers.be-ppi-hub-loyalty-http.entrypoints: http
traefik.http.routers.be-ppi-hub-loyalty-http.rule: Host(`apis.oreo.paintpro.co.id`)
&& PathPrefix(`/hub-loyalty`)
traefik.docker.network: traefik-public
traefik.enable: 'true'
resources:
reservations:
cpus: '0.1'
memory: 100M
limits:
cpus: '0.5'
memory: 1024M
networks:
traefik-public:
external: true