Dokploy / dokploy

Open Source Alternative to Vercel, Netlify and Heroku.
https://dokploy.com/
Other
6.54k stars 329 forks source link

Domains for services created via template #216

Closed brickpop closed 2 weeks ago

brickpop commented 1 month ago

What problem will this feature address?

Creating a service via a Template

Instead, creating a Docker service with the same Docker image URL works just fine

Describe the solution you'd like

Describe alternatives you've considered

Manual Docker compose settings didn't work. Tried this https://docs.dokploy.com/en/docs/core/docker-compose/domains#step-1-add-the-network

Additional context

No response

Siumauricio commented 1 month ago
  1. When you create a template it automatically generate the domains, all the enviroment variables with a prefix _HOST will be in the domains dropdown image
  2. The advanced features will not fit in docker compose since in docker compose we handle all the services in a single file, which in application is basically a single entity or just 1 service so that's why we can map some funcionalities like ports, redirects, volumes etc
  3. By default all the templates are served with traefik.me domains which are http, if you want to have https use your own domain https://docs.dokploy.com/en/docs/core/docker-compose/domains or check this video https://www.youtube.com/watch?v=3qr_celxISA&t=1s, at the end is the same but of course you will need to convert or add more or less traefik labels to each service to fit in to your needs, but to add your own domain is the same for every service of docker compose so with that guide will be enough for probably most cases
brickpop commented 1 month ago

Thank you for your response @Siumauricio

Regarding the example video, it seems to be loading the files from a git repository. In my case, I am testing Docker compose by manually copying the docker-compose.yaml file to run a well known service. For some reason (still investigating) the Traefik subdomain is not being picked by LetsEncrypt, no certificate and visiting the URL returns a 404 Not found.

Thank you!

Siumauricio commented 1 month ago

@brickpop

About the domains to be able to maintain a standard for docker compose is not something so simple for many reasons, the compose file usually have so many possibilities and ways of doing things, therefore it is not a viable solution, some time ago I had some idea about adding the domains to the services, but I still do not have it very clear yet, because you have to modify the file which I do not like much, as I mentioned for applications is something that if you can easily handle because it is an entity instead in compose there may be N services and can be a non-trivial solution to implement this.

(Volumes) I think the answer is similar to that of domains, we do not parse the docker compose files, besides I think the volumes are clear since they are defined in a docker compose file you do not have to have another layer to view, add or delete them, the only thing that does exist and is necessary are file volumes because many times you need to create configuration files and other things.

Of course the video loads using a Git repository, but the idea is the same for almost any use case.

Regarding the error is probably some configuration by your DNS provider, or something you are adding more in your docker compose.

If you would like me to help you with your problem, I would like you to share with me your compose file and which DNS provider you are using, So I can understand more the problem

brickpop commented 1 month ago

I understand, and appreciate the huge work behind Dokploy

1) How about querying from Docker itself, rather than trying to figure out what the docker-compose file has?

docker container ls --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" -a
# or
docker inspect -f "{{ .Mounts }}" <container-id>

I have an unrelated issue (probably should open a separate one) When I try to use a web hook to trigger a redeploy:

Thank you!

Siumauricio commented 1 month ago

I like that idea to parse the config of the inspect command, let's add this as roadmap I can extract alot of interesting things with this!

Regarding to this:

The given api/deploy/xxx URL returns {"message":"Application Not Deployable"} even if the app is running fine

I think you don't have activated the AutoDeploy toggle image

Clicking the reload button next to it shows an unrelated warning: Are you absolutely sure? This action cannot be undone. This will permanently delete the domain

Yeah I check and the text is incorrect

Altought I guess you are using github provider? if so you don't need to use the webhooks anymore, autodeploys are enabled by default

brickpop commented 1 month ago

That's very helpful, thank you :)

I'd like to suggest a few potential improvements:

Regarding the Domains topic, it would be very helpful if the domain/port HTTP proxy could be used on every type of container.

I hope that some of these ideas might ben helpful, thanks for suck a cool project ✨

Siumauricio commented 1 month ago

Thanks for the suggestions, appreciated!

  1. Autodeploy will be enabled in the next update by default.
  2. We will change the webhook messages

Can you give more details about the domains?

I think I will also work on integrating the domains in docker compose in a way that is quite friendly and similar to the applications.

brickpop commented 4 weeks ago

@Siumauricio sorry for the delay in replying

Trying to speak as a user advocate here ;) In general, users shouldn't need to care about the internal design of the tool they are using. For example, simple apps behaving differently that Docker compose wrappers. Also, needing to define a xxx_HOST env var (in some cases) to set domains, etc.

My suggestion was to make the existing Advanced > Domains tab available for all types of projects (app, docker compose, etc)

Any other details I can help with?