Skip to content

Instantly share code, notes, and snippets.

@wodCZ
Created August 15, 2017 14:16
Show Gist options
  • Save wodCZ/eb164e3e5f9f9de52b644acfa13e0730 to your computer and use it in GitHub Desktop.
Save wodCZ/eb164e3e5f9f9de52b644acfa13e0730 to your computer and use it in GitHub Desktop.
cron container
FROM openjdk:alpine
WORKDIR /usr/src/app
COPY build /usr/src/app
CMD ["/usr/src/app/job.sh"]
#!/bin/sh
# if interval env var is specified, loop, otherwise just run the process
INTERVAL=${HARVEST_COLLECTOR_INTERVAL}
if [ "$INTERVAL" == "" ]; then
java -jar /usr/src/app/harvestworker.jar
else
while [ 1 ]
do
java -jar /usr/src/app/harvestworker.jar
sleep "$INTERVAL"
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment