forked from dagu-org/dagu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (36 loc) · 989 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# 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
ENV DAGU_HOST=0.0.0.0
ENV DAGU_PORT=8080
CMD dagu server