In theory, you need to be ready to literally delete every container at any time and pull them from scratch and be 100% fine, since all of your actual data should be stored on the host and mounted as Docker volumes [0]. It's a good Doomsday test if you're looking for one. ;)
With kubernetes (and no more specifics than you've mentioned) you should use a Job.
With docker-compose I think I'd be tempted to have a different service that isn't long-running, and a cron job on the host that runs it.
With swarm, unless it supports something like k8s Jobs, (I don't know if it does or not, only used it once briefly and in anger) I'd probably have a 'cronjob' service which was responsible for launching the short-lived services per compose suggestion above.