I tried running a Docker container that ran a flask application. It works when I do
curl 0.0.0.0:50000
Since I get a response of the webpage. However, I'm unable to access it through my domain.
Currently on Traefik
v2.1.2
My docker-compose file is similar to the following:
version: "3"
networks:
proxy:
external: true
internal:
external: false
services:
hog:
# The official v2.0 Traefik docker image
image: traefik:v2.1.2
# Enables the web UI and tells Traefik to listen to docker
command:
- --entrypoints.web.address=:80
- --providers.docker
- --api
- --ping=true
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- proxy
labels:
- "traefik.http.routers.api.rule=Host(`subdomain.domain.tld`)"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=admin:password"
some-container:
image: username/some-container:latest
restart: always
labels:
- traefik.http.routers.some-container.rule=Host(`subdomain.domain.tld`)
- traefik.http.services.some-container.loadbalancer.server.port=50000
networks:
- proxy
- internal
It shows up in the dashboard fine, but I'm thinking that because I didn't specify the entrypoint may be the problem. But interestingly, when I run the following (in the same docker-compose file):
ghost:
image: ghost:latest
restart: always
ports:
- 2367-2368:2368
environment:
url: http://subdomain.domain.tld
database__client: sqlite3
networks:
- proxy
labels:
- traefik.http.routers.ghost.rule=Host(`subdomain.domain.tld`)
volumes:
- some volume
deploy:
It works perfectly. I'm thinking that maybe because I have around 20 services using the same entrypoint, this may cause the problem? Not completely sure. Will update if I fix this problem.