Sign inSign up

miebach/dagu

By miebach

Updated about 2 years ago

Image
0

414

miebach/dagu repository overview

Dockerfile

FROM debian:bookworm

RUN apt-get update && apt-get install -y \
        curl \
        wget \
        ranger \
        mc \
        apt-transport-https \
        ca-certificates \
        curl \
        gnupg2 \
        lsb-release \
        software-properties-common \
        && echo

# Prepare Docker installation
RUN echo "deb [arch=amd64 trusted=yes] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list

# Install docker
RUN apt-get update && \
  apt-get -y install \
  docker-ce \
  docker-ce-cli


# Move this up later
RUN apt-get update && \
  apt-get -y install \
  sudo

# CONFIG DAGU + CONTAINER
ARG DOWNLOADER="https://raw.githubusercontent.com/yohamta/dagu/main/scripts/downloader.sh"
ARG PORT=8080

ARG USER="appuser"
ARG HOME_DIR="/home/dagu"
# https://dagu.readthedocs.io/en/latest/config.html
ARG DAGU_HOME="$HOME_DIR/.dagu"

# create group and user
RUN groupadd -g 1000 $USER
RUN useradd \
    -u 1000 \
    -g 1000 \
    -m \
    -d $HOME_DIR \
    -s /bin/bash \
    $USER

# Activate sudo without password for $USER
RUN echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers

# docker group was already added by docker-ce
#RUN groupadd docker

ARG USER_UID=1000
ARG USER_GID=$USER_UID

# add to docker group
RUN usermod -aG docker $USER

USER $USER
RUN mkdir -p $DAGU_HOME

WORKDIR $HOME_DIR

RUN curl -L $DOWNLOADER | bash

USER root
# This is already done by the downloader:
#RUN mv $HOME_DIR/dagu /usr/local/bin
RUN chown 0:0 /usr/local/bin/dagu
RUN chmod a+x,a+r /usr/local/bin/dagu

USER $USER

EXPOSE $PORT

ENV DAGU_PORT=$PORT
ENV DAGU_HOST=0.0.0.0
ENV DAGU_HOME="$DAGU_HOME"

#CMD dagu server

Example docker compose

services:

    daguinit:
        # DAGU init container updates permission
        image: dagu-local:latest
        #image: "yohamta/dagu@sha256:fa0601cda94c714d9e7f0a06a2712eab1582c6b352486181d46176e0ad58f042" # 1.12.8 linux/amd`
        user: root
        env_file:
        - ./env/network
        - ./env/dagu
        - ./env/dagu.secret
        volumes:
        - ./d/dagu/:/home/dagu/.dagu
        command: chown -R 1000:1000 /home/dagu/.dagu/
        #
        #
    dagud:
        # DAGU ui web server process
        image: dagu-local:latest
        #image: "yohamta/dagu@sha256:fa0601cda94c714d9e7f0a06a2712eab1582c6b352486181d46176e0ad58f042" # 1.12.8 linux/amd`
        env_file:
        - ./env/network
        - ./env/dagu
        - ./env/dagu.secret
        environment:
        - DAGU_DAGS=/home/dagu/.dagu/dags
        - DAGU_IS_BASICAUTH=${DAGU_IS_BASICAUTH}
        - DAGU_BASICAUTH_USERNAME=${DAGU_BASICAUTH_USERNAME}
        - DAGU_BASICAUTH_PASSWORD=${DAGU_BASICAUTH_PASSWORD}
        ports:
        - "${DAGUD_PORT}:8080"
        volumes:
        - ./d/dagu/:/home/dagu/.dagu
        - /etc/hosts:/etc/hosts:ro
        - $HOME/.ssh:/home/dagu/.ssh:ro
        # docker.sock
        - /var/run/docker.sock:/var/run/docker.sock
        depends_on:
        - daguinit
        command: /usr/local/bin/dagu server
        #
        #
    dagusched:
        # DAGU scheduler process
        image: dagu-local:latest
        #image: "yohamta/dagu@sha256:fa0601cda94c714d9e7f0a06a2712eab1582c6b352486181d46176e0ad58f042" # 1.12.8 linux/amd`
        env_file:
        - ./env/network
        - ./env/dagu
        - ./env/dagu.secret
        environment:
        - DAGU_DAGS=/home/dagu/.dagu/dags
        volumes:
        - ./d/dagu/:/home/dagu/.dagu
        - /etc/hosts:/etc/hosts:ro
        - $HOME/.ssh:/home/dagu/.ssh:ro
        depends_on:
        - daguinit
        - dagud
        command: /usr/local/bin/dagu scheduler
...

Tag summary

Content type

Image

Digest

sha256:846dfd717

Size

434.8 MB

Last updated

about 2 years ago

docker pull miebach/dagu