forked from dagu-org/dagu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
48 lines (41 loc) · 1.05 KB
/
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# syntax=docker/dockerfile:1.4
FROM alpine:latest
ARG TARGETARCH
ARG VERSION=1.3.15
ARG RELEASES_URL="https://github.com/yohamta/dagu/releases"
ARG USER="dagu"
ARG USER_UID=1000
ARG USER_GID=$USER_UID
EXPOSE 8080
RUN <<EOF
#User and permissions setup
apk update
apk add --no-cache sudo tzdata
addgroup -g ${USER_GID} ${USER}
adduser ${USER} -h /home/${USER} -u ${USER_UID} -G ${USER} -D -s /bin/ash
echo ${USER} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USER}
chmod 0440 /etc/sudoers.d/${USER}
EOF
USER dagu
WORKDIR /home/dagu
RUN <<EOF
#dagu binary setup
if [ "${TARGETARCH}" == "amd64" ]; then
arch="x86_64";
else
arch="${TARGETARCH}"
fi
export TARGET_FILE="dagu_${VERSION}_Linux_${arch}.tar.gz"
wget ${RELEASES_URL}/download/v${VERSION}/${TARGET_FILE}
tar -xf ${TARGET_FILE} && rm *.tar.gz
sudo mv dagu /usr/local/bin/
mkdir .dagu
EOF
RUN <<EOF
#Creation of a minimal admin config file for the web ui
cat <<EOF2 > ~/.dagu/admin.yaml
host: 0.0.0.0
port: 8080
EOF2
EOF
CMD dagu server