organize icon indicating copy to clipboard operation
organize copied to clipboard

support for building docker container

Open fgma opened this issue 5 years ago • 5 comments

This PR adds support to build a docker container to deploying organize.

  • unit tests are run during build
  • config file is expected as /app/config.yaml inside the container and passed to the container using -v /home/user/.config/organize/config.yaml:/app/config.yaml
  • data directories are passed to the container using -v /data/documents:/data/documents
  • additional arguments to organize may be specified as a parameter to docker run
  • running the docker container with -e DELAY=5 will automatically run organize inside the container every 5 seconds until the container is stopped

If there is any interest in merging this I will add some documentation.

fgma avatar Jan 24 '20 18:01 fgma

Thank you, great stuff! My question is: should this dockerfile live in this repository or should you rather create register this on docker hub yourself?

There is already an alternative version provided by @dskaggs: https://hub.docker.com/r/dskaggs/docker-organize

So merging this PR would make it the offical docker container, I assume? I'm not using docker for organize myself at the moment so I would not be comfortable maintaining one.

I guess it would be best if you published this dockerfile on docker hub in your name and I link to it in the readme? Additionally I can create a webhook to trigger a docker image build on a new release.

Any remarks / objections?

tfeldmann avatar Mar 04 '20 15:03 tfeldmann

Ideally it would be added to this repository. It is designed to be build locally from a checkout. In the first place I used it mainly for testing my last PR against different python versions. Later on I started using it to deploy organize because I don't like to deploy using pip to production setups.

The dockerfile from @dskaggs will just use the current release via pip. Mine uses the current checkout and also runs unit-tests during build and is therefor more development oriented. Its also quite easy to switch to different python versions using my dockerfile.

I understand that you don't want to maintain a dockerfile if you are not using docker at all. If there is any interest in having this maintained I may look into dockerhub. Otherwise I will just use this for my private deployments and maybe someone finds it here to use it for himself.

fgma avatar Mar 10 '20 17:03 fgma

Hi @tfeldmann, what is the current status regarding Docker? If there is a need, I could also support you. Regards Fabian

GermanFab avatar Dec 20 '21 20:12 GermanFab

@tfeldmann Ideally, this Dockerfile should be kept in your repo so that it can be used by GitHub to test and build the Docker image and deploy it to DockerHub.

Then we could add a docker-compose.yml file for deploying the image to our own environments.

Lastly, we could alter @fgma 's entrypoint file to look for optional environment variables to determine if the container should be run once and exit or stay alive and run the organize command on a schedule as a CRON job (which is what I need since I need to deploy this to my Docker Swarm and have it automatically run against a particular folder structure on a schedule).

dskaggs avatar Dec 24 '21 19:12 dskaggs

thx @dskaggs for your image

i forked your respotory and change the dockerfile a little. because the output was owned by root. so i added a user to the dockerfile.

Here the story: https://github.com/tfeldmann/organize/discussions/215

wintuxx avatar May 22 '22 19:05 wintuxx

Hi, please could someone share the latest on running Organize via Docker ? I’m keen to use it, but unfortunately I’ve been unable to get @dskaggs one to work.

nodecentral avatar Apr 22 '23 10:04 nodecentral

Thinking about this - how should the trash action be handled in this case?

tfeldmann avatar Sep 07 '23 17:09 tfeldmann