diff --git a/diffy/Dockerfile b/diffy/Dockerfile new file mode 100644 index 0000000..e1d297c --- /dev/null +++ b/diffy/Dockerfile @@ -0,0 +1,9 @@ +### Add "diffy" user to the container. +ARG BASE_IMAGE +FROM $BASE_IMAGE +SHELL ["/bin/bash", "-c"] + +ARG username +ARG uid +ARG gid +RUN (groupadd --gid $gid "$username" || groupadd "$username" || true) && (useradd -l -m -s "/bin/bash" --gid "$username" --comment '' --uid $uid "$username" || useradd -l -m -s "/bin/bash" --gid "$username" --comment '' "$username" || useradd -l -m -s "/bin/bash" --gid "$gid" --comment '' "$username" || useradd -l -m -s "/bin/bash" --comment '' $username ) diff --git a/docker-compose.diffy.yaml b/docker-compose.diffy.yaml index a49d08a..10bce96 100644 --- a/docker-compose.diffy.yaml +++ b/docker-compose.diffy.yaml @@ -3,6 +3,14 @@ services: diffy: container_name: ddev-${DDEV_SITENAME}-diffy image: diffywebsite2/screenshot-worker:0.0.1 + user: '$DDEV_UID:$DDEV_GID' + build: + context: 'diffy' + args: + BASE_IMAGE: diffywebsite2/screenshot-worker:0.0.1 + username: "diffy" + uid: ${DDEV_UID} + gid: ${DDEV_GID} command: tail -f /dev/null restart: "no" # These labels ensure this service is discoverable by ddev. diff --git a/install.yaml b/install.yaml index 4f9cf60..ce3388b 100644 --- a/install.yaml +++ b/install.yaml @@ -46,6 +46,7 @@ project_files: - docker-compose.diffy.yaml - commands/diffy/screenshot - config.diffy.yaml +- diffy/Dockerfile # List of files and directories that are copied into the global .ddev directory # DDEV environment variables can be interpolated into these filenames @@ -95,6 +96,7 @@ removal_actions: - rm -rf commands/diffy - rm -rf diffy-worker-main - rm config.diffy.yaml + - rm -rf diffy # Advanced usage - yaml files can be read in and then used as go template actions # in pre_install_actions and post_install_actions