Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Services deployed via Dokploy Inaccessible After Customizing Traefik Ports via Environment Variables #804

Open
chuyun opened this issue Dec 3, 2024 · 9 comments · May be fixed by Dokploy/website#14
Labels
bug Something isn't working

Comments

@chuyun
Copy link
Contributor

chuyun commented Dec 3, 2024

To Reproduce

  1. Customize the TRAEFIK_PORT and TRAEFIK_SSL_PORT environment variables as per the instructions in How to make Dokploy to do not require port 80 and 443 to be avilable? #130 .
  2. Restart the relevant services.
  3. Attempt to access the services through Traefik.

Current vs. Expected behavior

Expected Behavior
The services should be accessible through the customized ports without any issues.

Actual Behavior
All reverse-proxied services become inaccessible.

Provide environment information

Dokploy Version: v0.13.1

Which area(s) are affected? (Select all that apply)

Traefik

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

After following the guidance from Issue #130 to customize the environment variables TRAEFIK_PORT and TRAEFIK_SSL_PORT, all services reverse-proxied through Traefik become inaccessible. We need to discuss whether a general solution should be provided in Dokploy to resolve this issue.

Will you send a PR to fix it?

Maybe, need help

@chuyun chuyun added the bug Something isn't working label Dec 3, 2024
@chuyun chuyun changed the title Services Inaccessible After Customizing Traefik Ports via Environment Variables Services deployed via Dokploy Inaccessible After Customizing Traefik Ports via Environment Variables Dec 3, 2024
@ccinoo

This comment was marked as off-topic.

@Siumauricio
Copy link
Contributor

I see that it doesn't work, I don't know if it is due to the migration that we had done from traefik 2.5 to 3.10, I was playing for a couple of hours but it doesn't seem to work, I think I will need more time to check this.

@aliuq
Copy link

aliuq commented Dec 20, 2024

I seem to have encountered the same problem. I could access it before, but since the upgrade, accessing through the domain name only returns 404 page not found. I am not sure whether it is a problem with my configuration or a problem with dokploy.

@nktnet1
Copy link

nktnet1 commented Dec 25, 2024

I got it working with the following script, which changes port 80 -> 81 and port 443 -> 444:

EDIT: Did not work (see edit for the old non-working code)

@Siumauricio happy to make a pull request + update the docs if needed ^

@Siumauricio
Copy link
Contributor

@nktnet1 would be great if you are able to make a pull request !

@nktnet1 nktnet1 linked a pull request Dec 25, 2024 that will close this issue
@nktnet1
Copy link

nktnet1 commented Dec 25, 2024

I've made the pull request on the Dokploy/Website repository :)

@Siumauricio
Copy link
Contributor

@nktnet1 Reviewing carefully the script, why does it assign the https and http port to the dokploy container? when it has nothing to do and the one that should have the exposed port should be the dokploy-traefik container, if you can give details to understand it would be great, I tried the script but it does not work, because if you assign the port 81 and 444 for example it will be assigned to the dokploy container and not to traefik which is who balances the services.

@nktnet1
Copy link

nktnet1 commented Dec 25, 2024

hmm yeah my bad, I did it in a rush and thought it was working, but turns out not (and doesn't make much sense either). Traefik was basically stopped from starting and through some of my old configurations from coolify, it happened to work.
Will spend some time investigating after the holidays - sorry for the confusion ^.

@patillacode
Copy link

patillacode commented Dec 26, 2024

I am on the same boat.

Hopefully I'll give you an idea if I specify my scenario!

I installed dokploy in a brand new VPS (Hetzner) and I just setup a project with one service via the Compose option.

Deployment goes fine and accessing the naked IP in the browser works under the port I setup in the docker-compose.yml file .

Now the issue: when trying to access via a custom domain I get the same 404 behaviour described above.

I have tried different ports (3000, 5058, 8000) without success.

I checked the traefik config and it has the ports 80 and 443 as you can see below

providers:
  swarm:
    exposedByDefault: false
    watch: false
  docker:
    exposedByDefault: false
  file:
    directory: /etc/dokploy/traefik/dynamic
    watch: true
entryPoints:
  web:
    address: ':80'
  websecure:
    address: ':443'
    http:
      tls:
        certResolver: letsencrypt
api:
  insecure: true
certificatesResolvers:
  letsencrypt:
    acme:
      email: [email protected]
      storage: /etc/dokploy/traefik/dynamic/acme.json
      httpChallenge:
        entryPoint: web

I am not an expert on this matter at all but I am open to help,

PS: awesome tool! thanks for making it happen @Siumauricio !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
6 participants