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

Consider more idomatic docker config #715

Closed
chrishoage opened this issue Nov 16, 2024 · 3 comments · Fixed by #723
Closed

Consider more idomatic docker config #715

chrishoage opened this issue Nov 16, 2024 · 3 comments · Fixed by #723

Comments

@chrishoage
Copy link
Contributor

chrishoage commented Nov 16, 2024

While working on my PR I made extensive changes to the Dockerfile and I'm wondering if you think I should upstream them.

  • I added an entrypoint.sh which configured the environment
  • Using the entrypoint allow the user to specify the DOCKER_GID and add dagu to the docker group
  • Use su-exec to execute dagu as the dagu user
  • Changed the home directory and DAGU_HOME to be /config. This is a more idiomatic way of handling docker container configs
  • removed sudo and dagu in sudoers

What this allows for is a much cleaner docker compose setup.

  • No need to run a container o run socat and forward the docker socket. Just bind to to the container
  • Allows users to load extra config though /entrypoint.d/*.sh (this is not done in my test branch, but could very easily be added. I have a lazy ADDITIONAL_PACKAGES but I don't think this should be shipped as is)

You can look at my changes here chrishoage@23eae41 and if any of these are worth upstreaming I can produce a PR with the parts you think would be a good fit for the official docker image.

services:
  caddy:
    image: caddy
    container_name: caddy
    hostname: caddy
    ports:
      - "8080:80"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
  dagu:
    image: ch/dagu
    container_name: dagu
    hostname: dagu
    volumes:
      - ./config:/config
      - ./scripts:/scripts
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      # - ADDITIONAL_PACKAGES=docker-cli deno bash
      - PUID=1000
      - PGID=1000
      - DOCKER_GID=970
      - DAGU_TZ=America/Los_Angeles
http://localhost {
  handle /dagu* {
    reverse_proxy dagu:8080
  }
}
@chrishoage
Copy link
Contributor Author

To be clear I'm happy to upstream only parts of this. I realize that the /config change is a breaking change and may not be desirable.

I think the entrypoint.sh changes shouldn't be breaking changes in cases where people followed the existing docker compose examples.

If all or part of these changes would be welcome upstream I am happy to break apart the work

@yohamta
Copy link
Collaborator

yohamta commented Nov 18, 2024

Hey @chrishoage, thank you for the great suggestion! Yes, a PR for that would be much appreciated! :)

@chrishoage
Copy link
Contributor Author

Okay I will work on cleaning up my changes and upstream them.

I will attempt to make everything backwards compatible as much as I can, but the move to /config may make that difficult. We'll see.

(I'm a little busy a the moment so this may take until next week to complete)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants