Open Zeropeace opened 3 years ago
I don't think anyone has ever tested Traefik. But anyway Traefik is supposed to detect the needed configuration as far as I know. If it doesn't (and I quote from its community) you're more than often fucked. There's simply not the time to experiment with non-standard proxy software. Sorry
Yea as he said, in so many words, traefik is awesome when it just works but a little mysterious when it doesnt. I have it working in my setup FWIW (+ authelia), biggest difference is I use traefik docker labels which does the auto configuration magic, see below in case it helps you...
planka:
image: meltyshev/planka:latest
container_name: planka
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:
- /path/to/planka/avatars:/app/public/user-avatars
- /path/to/planka/background-images:/app/public/project-background-images
- /path/to/planka/attachments:/app/public/attachments
ports:
- 1337:1337
environment:
- BASE_URL=https://tasks.domain.com
- DATABASE_URL=postgresql://postgres@planka-db/planka
- SECRET_KEY=***
depends_on:
- planka-db
networks:
- macvlan_network
- traefik_proxy
- default
labels:
- traefik.http.routers.planka.rule=Host(`tasks.domain.com`)
- traefik.http.routers.planka.tls.certresolver=le
- traefik.http.routers.planka.entrypoints=websecure
- traefik.http.routers.planka.middlewares=chain-authelia
- traefik.http.services.planka.loadbalancer.server.port=1337
- traefik.docker.network=traefik_proxy
I want to run Planka in docker container with Traefik as a reverse Proxy . But i have encountered a problem. If i route Planka thru Traefik i can only get to the Log In page and then after i log in it keeps loading for ever. This does not occur when i acces it with the IP:PORT combo. I have added my docker-compose and traefik config. I also found a cryptic log from Traefik wich might be useful.
Here's an alternative: run Traefik in a container. It's easier to manage your services and network, no IP or port to configure on your host.
If you want I can dust off a pi and give you a running config for both Traefik and Planka.
The configuration you posted is a bit weird to me because I read some pihole and plank.my.domain in the same Traefik config but you can't run it on a local network in front of a pihole and on public server. What's your network setup ?
What it means is that your planka container's IP may change everytime you recreate the container:
planka:
loadBalancer:
servers:
- url: "http://192.168.178.85:3000"
Traefik can only read a container's labels when linked to the docker socket.
I use traefik as a container, auto-discovering docker containers.
I also had this forever loading bug until I changed the BASE_URL
environment variable, matching the https (instead of http) traefik rule I defined in order to make planka reachable from outside.
My conf is a little bit different, but in case it may help, here it is
.env
docker-compose.yml
Have been fighting this for a couple of hours now. apparently the planka container has issues with multiple networks
planka_1 | Error: connect EHOSTUNREACH 192.168.0.2:5432
planka_1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1138:16) {
planka_1 | errno: -113,
planka_1 | code: 'EHOSTUNREACH',
planka_1 | syscall: 'connect',
planka_1 | address: '192.168.0.2',
planka_1 | port: 5432
planka_1 | }
at some point I tryed to bindmount the Unix socket
into the container, but the DATABASE_URL
didn't took this and always failed back to localhost, bummer..
not working:
version: '3'
# as per https://github.com/plankanban/planka/blob/master/docker-compose.yml
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:
- ${PROJECT_FOLDER}/user-avatars:/app/public/user-avatars
- ${PROJECT_FOLDER}/project-background-images:/app/public/project-background-images
- ${PROJECT_FOLDER}/attachments:/app/public/attachments
- ${PROJECT_FOLDER}/pg-run:/var/run/postgresql
env_file:
- ${PROJECT_FOLDER}/.env
# ports:
# - 3000:1337
networks:
- traefik
- internal_planka
environment:
- BASE_URL=${BASE_URL}
- TRUST_PROXY=0
- DATABASE_URL=postgresql://postgres@postgres_planka/planka
- SECRET_KEY=${SECRET_KEY}
depends_on:
- postgres_planka
labels:
- traefik.http.routers.planka.rule=Host(`kanban.${DOMAINNAME}`)
- traefik.http.services.planka.loadbalancer.server.port=1337
- traefik.docker.network=traefik
postgres_planka:
image: postgres:alpine
container_name: postgres_planka
restart: unless-stopped
volumes:
- ${PROJECT_FOLDER}/db-data:/var/lib/postgresql/data
networks:
- internal_planka
# expose: # no diffrence
# - 5432
environment:
- POSTGRES_DB=planka
- POSTGRES_HOST_AUTH_METHOD=trust
networks:
internal_planka:
name: internal_planka
internal: true
traefik:
name: traefik
external: true
working:
version: '3'
# as per https://github.com/plankanban/planka/blob/master/docker-compose.yml
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:
- ${PROJECT_FOLDER}/user-avatars:/app/public/user-avatars
- ${PROJECT_FOLDER}/project-background-images:/app/public/project-background-images
- ${PROJECT_FOLDER}/attachments:/app/public/attachments
- ${PROJECT_FOLDER}/pg-run:/var/run/postgresql
env_file:
- ${PROJECT_FOLDER}/.env
# ports:
# - 3000:1337
networks:
- traefik
environment:
- BASE_URL=${BASE_URL}
- TRUST_PROXY=0
- DATABASE_URL=postgresql://postgres@postgres_planka/planka
- SECRET_KEY=${SECRET_KEY}
depends_on:
- postgres_planka
labels:
- traefik.http.routers.planka.rule=Host(`kanban.${DOMAINNAME}`)
- traefik.http.services.planka.loadbalancer.server.port=1337
- traefik.docker.network=traefik
postgres_planka:
image: postgres:alpine
container_name: postgres_planka
restart: unless-stopped
volumes:
- ${PROJECT_FOLDER}/db-data:/var/lib/postgresql/data
networks:
- traefik
# expose: # no diffrence
# - 5432
environment:
- POSTGRES_DB=planka
- POSTGRES_HOST_AUTH_METHOD=trust
networks:
traefik:
name: traefik
external: true
Why this is the case, I really have no idea. The only container that displayed this absurd behaviour was keycloak.
on a personal note, @loranger cool trick with the collapsible code snippets, when I try it the shared code gets all wonky, care to share how you did this?
5432
is the PostgreSQL default port.
It could be postgres which is not started, or incorrect credentials or connections not allowed from 192.168.0.2.
The latter should be the real issue because planka seems working fine with one network only.
I'm no specialist, but you should take a look at the postgresql conf (maybe pg_hba.conf file) use by default inside postgres:alpine image
Regarding the collapsible markup, you should take a look at the cheatsheet and then figure out your code was certainly messy because of the missing blank lines. Now you can use it as soon as you have too much lines to share. At least that's what I do ;)
I installed telnet inside of the app container and tried to reach the the PG database.
I think I was getting a Connection refused
but cant be certain anymore. The resolved IP was right, but even a nmap scan didn't showed a open PG port.
But on the other side, the name resolution works. I thought the POSTGRES_HOST_AUTH_METHOD
var would work around this.
Had like 15 edidts, but the yaml code-block just thew up on my tryes .
edit: yea, still looks like ****
edit: Didnt closed the shell window
/app # bash
bash-5.0# telnet postgres_planka
telnet: can't connect to remote host (172.28.0.2): Host is unreachable
bash-5.0# telnet postgres_planka ^C
bash-5.0# ^C
bash-5.0# ping postgres_planka
PING postgres_planka (172.28.0.2): 56 data bytes
64 bytes from 172.28.0.2: seq=0 ttl=64 time=0.112 ms
64 bytes from 172.28.0.2: seq=1 ttl=64 time=0.221 ms
^C
--- postgres_planka ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.112/0.166/0.221 ms
bash-5.0# telnet postgres_planka
telnet: can't connect to remote host (172.28.0.2): Host is unreachable
bash-5.0# telnet postgres_planka 5432
telnet: can't connect to remote host (172.28.0.2): Host is unreachable
Host is up (0.00011s latency).
rDNS record for 172.28.0.2: postgres_planka.kanban-planka_internal
All 1000 scanned ports on postgres_planka (172.28.0.2) are filtered
MAC Address: 02:42:AC:1C:00:02 (Unknown)
Nmap done: 1 IP address (1 host up) scanned in 5.54 seconds
hi guys i have the same error, my solution it was set the same BASE_URL as traefik.http.routers.server.rule traefik parameter, in others worlds
Hi all,
I want to run Planka in docker container with Traefik as a reverse Proxy . But i have encountered a problem. If i route Planka thru Traefik i can only get to the Log In page and then after i log in it keeps loading for ever. This does not occur when i acces it with the IP:PORT combo. I have added my docker-compose and traefik config. I also found a cryptic log from Traefik wich might be useful.