DefGuard / deployment

Deployment files for defguard service
Other
7 stars 5 forks source link

What's the reason of mouting files? #21

Closed orlovmyk closed 6 months ago

orlovmyk commented 7 months ago

https://github.com/DefGuard/deployment/blob/c599c0ad06cd31adeaa4ababc6ed15530cbd1b60/docker-compose/docker-compose.yaml#L20

https://github.com/DefGuard/deployment/blob/c599c0ad06cd31adeaa4ababc6ed15530cbd1b60/docker-compose/docker-compose.yaml#L21

https://github.com/DefGuard/deployment/blob/c599c0ad06cd31adeaa4ababc6ed15530cbd1b60/docker-compose/docker-compose.yaml#L22

I have faced this issue too many times when Docker shim can't mount file in directory during first time setup, is this necessary? Maybe better to mount whole directory?

teon commented 7 months ago

@wojcik91 can you relate?

wojcik91 commented 7 months ago

Hi @orlovmyk Thank you for pointing this out. Are you using the one-line install script or just the docker-compose.yaml file? Does the Caddyfile exist?

Mounting the whole directory would not solve this particular issue, since I expect the problematic part is the Caddyfile which should be mounted into a separate directory. And if the Caddyfile doesn't exist there's no reason to start Caddy itself.

Current iteration of the docker-compose.yaml file was prepared with the install script in mind and I can now see that it can cause issues for users who want to just use the file itself for manual deployment. I'll have to update it to avoid further confusion.

orlovmyk commented 7 months ago

@wojcik91 Thanks for reply, yep I am not using one-line script to install as far as I wanted to dig a little bit deeper. Anyways I moved caddy outside of the docker-compose, so it's not a problem for me anymore, but you are right It needs to be provided in docs.

Also as solution you can create simple Caddyfile inside repo, that will be overridden by one-install script. For example reverse-proxy to core only as base.

By the way project is 🔥