mirror of
https://github.com/amineo/t2-stat-parser.git
synced 2026-01-19 17:34:43 +00:00
Use cron to the keep the container alive
This commit is contained in:
parent
e596b0ca7c
commit
15d89ae5e1
|
|
@ -5,5 +5,5 @@ echo "T2 Stat Parser Running...";
|
||||||
# Run this initially, then we'll execute this on a schedule
|
# Run this initially, then we'll execute this on a schedule
|
||||||
./start.sh
|
./start.sh
|
||||||
|
|
||||||
# Keep container running
|
# Keep container running with the cron schedule
|
||||||
tail -f /dev/null
|
crond -l 2 -f
|
||||||
|
|
@ -7,5 +7,6 @@ then
|
||||||
/app/main
|
/app/main
|
||||||
else
|
else
|
||||||
echo "No build found, running from source"
|
echo "No build found, running from source"
|
||||||
|
cd /app
|
||||||
go run *.go
|
go run *.go
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ RUN apk update && apk add --no-cache wget tzdata
|
||||||
ENV TZ=America/New_York
|
ENV TZ=America/New_York
|
||||||
|
|
||||||
#Set cron schedule (every day at 9:30am est)
|
#Set cron schedule (every day at 9:30am est)
|
||||||
RUN crontab -l -u root | echo "30 9 * * * sh -c \"/app/start.sh\"" | crontab -u root -
|
RUN echo '30 9 * * * /app/start.sh' > /etc/crontabs/root
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue