Hello Traefik-Community,
I got into a project where i am currently alone and also the ones working on it before don't bother to help... I was only working in the files not directly correlating to docker so I am quite new in the field. I have removed docker swarm and stack because i was told to do so the containers are running and everything looks fine until you want to connect to https. The logs of the traefik instance has only one message: level=info msg="Configuration loaded from flags.
I tried coping a few tutorials online, but i get confused because this project has more containers running. Here is the docker-compose.yml...: I am very grateful for any help! If it helps I think the project was made a long time ago with a project generator. Thank you in advance!
services:
proxy:
image: traefik:v2.11
networks:
- traefik-public
- default
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik-public-certificates:/certificates
command:
- --log.level=DEBUG
- --providers.docker
- --providers.docker.exposedbydefault=false
- --entrypoints.http.address=:80
- --entrypoints.https.address=:443
- --certificatesresolvers.le.acme.email=myemail
- --certificatesresolvers.le.acme.storage=/certificates/acme.json
- --certificatesresolvers.le.acme.tlschallenge=true
- --accesslog
- --log
- --api
environment:
- TRAEFIK_PUBLIC_TAG=${TRAEFIK_PUBLIC_TAG}
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
- traefik.http.middlewares.https-redirect.redirectscheme.permanent=true
- traefik.http.routers.proxy-http.rule=Host(`theactualdomain.de`) || Host(`www.theactualdomain.de`)
- traefik.http.routers.proxy-http.entrypoints=http
- traefik.http.routers.proxy-http.middlewares=https-redirect
- traefik.http.routers.proxy-https.rule=Host(`theactualdomain.de`) || Host(`www.theactualdomain.de`)
- traefik.http.routers.proxy-https.entrypoints=https
- traefik.http.routers.proxy-https.tls=true
- traefik.http.routers.proxy-https.tls.certresolver=le
db:
image: postgres:12
volumes:
- app-db-data:/var/lib/postgresql/data/pgdata
env_file:
- .env
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
pgadmin:
image: dpage/pgadmin4:2021-04-19-1
networks:
- traefik-public
- default
env_file:
- .env
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.pgadmin-http.rule=Host(pgadmin.theactualdomain.de
)
- traefik.http.routers.pgadmin-http.entrypoints=http
- traefik.http.routers.pgadmin-http.middlewares=https-redirect
- traefik.http.routers.pgadmin-https.rule=Host(pgadmin.theactualdomain.de
)
- traefik.http.routers.pgadmin-https.entrypoints=https
- traefik.http.routers.pgadmin-https.tls=true
- traefik.http.routers.pgadmin-https.tls.certresolver=le
- traefik.http.services.pgadmin.loadbalancer.server.port=5050
backend:
image: '${DOCKER_IMAGE_BACKEND}:${TAG-latest}'
volumes:
- pictures:/var/lib/pictures
- profilepictures_user:/var/lib/profilepictures_user
env_file:
- .env
environment:
- SERVER_NAME=theactualdomain.de
- SERVER_HOST=https://theactualdomain.de
build:
context: ./backend
dockerfile: backend.dockerfile
labels:
- traefik.enable=true
- traefik.http.routers.backend-http.rule=PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`)
- traefik.http.services.backend-service.loadbalancer.server.port=80
frontend:
image: '${DOCKER_IMAGE_FRONTEND}:${TAG-latest}'
build:
context: ./frontend
args:
FRONTEND_ENV: ${FRONTEND_ENV-production}
labels:
- traefik.enable=true
- traefik.http.routers.frontend-http.rule=PathPrefix(/
)
- traefik.http.services.frontend-service.loadbalancer.server.port=80
volumes:
app-db-data:
pictures:
profilepictures_user:
traefik-public-certificates:
networks:
traefik-public:
external: false