Updated to set cron to execute awp-cli check every 2 minutes
This commit is contained in:
parent
5a8f2195e1
commit
01a4d51543
2 changed files with 9 additions and 2 deletions
10
Dockerfile
10
Dockerfile
|
|
@ -18,6 +18,11 @@ RUN chmod +x /app/awp-cli
|
|||
|
||||
RUN apk add --no-cache cronie
|
||||
|
||||
# Install the crontab: runs `./awp-cli check` every 2 minutes,
|
||||
# logging output to /app/logs/cron.log (logs/ is mounted at runtime).
|
||||
COPY crontab.txt /app/crontab.txt
|
||||
RUN crontab /app/crontab.txt
|
||||
|
||||
# NOTE: static/, players.json, .env, and logs/ are no longer copied
|
||||
# into the image. They're mounted at runtime via docker-compose.yml
|
||||
# so they live on the host and persist/update independently of the image.
|
||||
|
|
@ -26,5 +31,6 @@ RUN apk add --no-cache cronie
|
|||
#EXPOSE 8080
|
||||
EXPOSE 3000
|
||||
|
||||
# Set the default command
|
||||
CMD crond & /app/areweplaying
|
||||
# crond forks into the background on its own (daemon mode), then
|
||||
# areweplaying takes over as PID 1 via exec so it gets signals properly.
|
||||
CMD crond && exec /app/areweplaying
|
||||
|
|
|
|||
1
crontab.txt
Normal file
1
crontab.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
*/2 * * * * cd /app && ./awp-cli check >> /app/logs/cron.log 2>&1
|
||||
Loading…
Reference in a new issue