-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
26 lines (18 loc) · 804 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Use Alpine Linux as the base image
FROM alpine:latest
# Install required packages including cron, audio tools, and dependencies
RUN apk add --no-cache busybox-suid tzdata mpg123 alsa-lib alsa-utils
# Set the working directory in the container
WORKDIR /app
# Copy the script and necessary files to the container
COPY morse.sh /app/morse.sh
COPY morse /app/morse
# Make the script executable
RUN chmod a+x /app/morse.sh
# Set the time zone to Asia/Kuala_Lumpur using the environment variable
ENV TZ=Asia/Kuala_Lumpur
RUN cp /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone
# Add the cron job directly
RUN echo "0 * * * * /app/morse.sh" > /etc/crontabs/root
# Use an entrypoint script to start multiple processes
ENTRYPOINT ["/bin/sh", "-c", "crond -f -L /var/log/cron.log"]