Open h2seo opened 3 years ago
It's a Traefik misconfiguration, the port you tell Traefik to send traffic to is wrong.
Try this:
labels:
- traefik.backend=planka
- traefik.frontend.rule=Host:planka.x069.duckdns.org
- traefik.docker.network=web
- traefik.port=1337
- traefik.enable=true
And you can remove this part unless you want to be able to access planka directly from opened port 3000 on your server:
ports:
- 3000:1337
If you still get bad gateway
it means Traefik can't find a port on the container, so expose it (to Traefik and end points on your docker web network) but normally planka exposes this port by default:
expose:
- "3000"
Make sure the traefik container can talk with the docker web network:
$ docker connect web traefik
edit: here's a working docker-compose I wrote from the one you supplied. I am using Traefik2 with self-signed certificates on localhost but planka service don't need to change:
---
networks:
default:
external:
name: planka
services:
planka:
image: meltyshev/planka:latest
command: >
bash -c
"for i in `seq 1 30`; do
./start.sh &&
s=$$? && break || s=$$?;
echo \"Tried $$i times. Waiting 5 seconds...\";
sleep 5;
done; (exit $$s)"
restart: unless-stopped
volumes:
- user-avatars:/app/public/user-avatars
- project-background-images:/app/public/project-background-images
- attachments:/app/public/attachments
labels:
- traefik.enable=true
- traefik.http.routers.planka.entrypoints=https
- traefik.http.routers.planka.rule=Host(`planka.localhost`)
- traefik.http.routers.planka.tls=true
- traefik.http.services.planka.loadbalancer.server.port=1337
environment:
- BASE_URL=https://planka.localhost # am using https but http is fine if you configured traefik to use http
- DATABASE_URL=postgresql://postgres@postgres/planka
- SECRET_KEY=notsecretkey
depends_on:
- postgres
postgres:
image: postgres:alpine
restart: unless-stopped
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=planka
- POSTGRES_HOST_AUTH_METHOD=trust
version: 3.4
volumes:
user-avatars:
project-background-images:
attachments:
db-data:
Then:
$ docker network create planka ; docker network connect planka traefik ; docker-compose up -d ;
I wanted to try Planka on docker compose with Traefik but it doesn't seem to work. only error "Bad Gateway"
docker-compose.yml