i really have no clue anymore, i tried almost every combination i could imagine but in the end was not able to find a solution that fits. Have have a dockerized app that depends on elasticsearch, redis, traefik and postgres
but for some reason the networking communication between traefik and my actuall app seems to be somehow broken. I simply want that im able to reach my app at 127.0.0.1:80 but traefik alsways returns 404 not found
version: '3'
networks:
backend-app:
internal: true
frontend-app:
internal: false
volumes:
esdata:
driver: local
postgresdata:
driver: local
services:
app-proxy:
container_name: app-proxy
image: traefik # The official Traefik docker image
command: --api --docker # Enables the web UI and tells Traefik to listen to docker
ports:
- 80:80 # The HTTP port
- 8080:8080 # The Web UI (enabled by --api)
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
depends_on:
- myproject
networks:
- frontend-app
- backend-app
redis:
image: redis:alpine
container_name: app-redis
networks:
- backend-app
ports:
- 6379
labels:
- traefik.enable=false
postgres:
image: postgres:latest
container_name: app-postgres
networks:
- backend-app
ports:
- 5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: mysupersecretpass
POSTGRES_DB: myproject
volumes:
- postgresdata:/var/lib/postgresql/data
labels:
- traefik.enable=false
elasticsearch:
image: elasticsearch:6.5.3
container_name: app-elasticsearch
environment:
- cluster.name=app-cluster
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms2048m -Xmx2048m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata:/usr/share/elasticsearch/data
ports:
- 9200
networks:
- backend-app
labels:
- traefik.enable=false
myproject:
build: .
command: bash -c "python manage.py makemigrations myproject myproject_Accounts && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
container_name: app
volumes:
- .:/myproject
labels:
- traefik.backend=app
- traefik.enable=true
- traefik.passHostHeader=true
- traefik.frontend.rule=Host:app
- traefik.docker.network=frontend-app
- traefik.port=8000
networks:
- backend-app
depends_on:
- postgres
- elasticsearch
- redis
ports:
- 8000
How would you get this done if you want that the proxy routet app is the only accessible entrypoint for the deployment at http://127.0.0.1:80 and have elasticsearch, redis, postgres routed internal
many thanks in advance