Found the solution, comment please if this approach is wrong.
Added my sub-domains in AWS route53:

In docker-compose.yml file, added traefik and added my other images on the same network (t2_proxy)
traefik:
image: "traefik:v2.9"
container_name: $DOCKER_IMAGE_TRAEFIK
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
labels:
- traefik.enable=true
- traefik.http.routers.api.rule=Host(`$DOCKER_TRAEFIK_HOST_PROXY`)
- traefik.http.routers.api.entrypoints=web
- traefik.http.routers.api.service=api@internal
# - traefik.port=8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
networks:
- t2_proxy
- postgreNetwork
- elk
In this config, $DOCKER_IMAGE_TRAEFIK is traefik image name from my .env file. You can add your image name and $DOCKER_TRAEFIK_HOST_PROXY is the host name e.g. proxy.example.com
for port configuration:
phpmyadmin:
image: phpmyadmin:latest
platform: linux/amd64
container_name: $DOCKER_IMAGE_PHPMYADMIN
links:
- mysqldb
networks:
- t2_proxy
environment:
PMA_HOST: mysqldb
PMA_PORT: ${MYSQL_PORT:-3306}
# ports:
# - "${PHPMYADMIN_PORT:-7865}:80"
labels:
- "traefik.enable=true"
- "traefik.http.routers.phpmyadmin.rule=Host(`$DOCKER_TRAEFIK_HOST_PHPMYADMIN`)"
- "traefik.http.routers.phpmyadmin.entrypoints=web"
- "traefik.http.routers.phpmyadmin-rtr.tls=true"
- "traefik.port=$PHPMYADMIN_PORT"
volumes:
- /sessions
In this config, $DOCKER_IMAGE_PHPMYADMIN is phpmyadmin image name and $PHPMYADMIN_PORT is 7865 from my .env file. You can change as you want. $DOCKER_TRAEFIK_HOST_PHPMYADMIN is the host name e.g. phpmyadmin.example.com
In this example. I have blocked port access and I can access the sub-domain properly. the same setting for LAMP, ELK, Node, and React in my project.