From b9e339f1d093533f58e83417a0153c33b63a17b0 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 11 Sep 2021 21:06:06 -0400 Subject: [PATCH] feat: add devcontainer support This should make it possible to run tests locally in a lighter way than pulling up a full VM. --- .devcontainer/Dockerfile | 20 ++++++++++++++++++++ .devcontainer/devcontainer.json | 8 ++++++++ 2 files changed, 28 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..4174b21 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,20 @@ +FROM dokku/dokku:latest + +RUN apt-get update +RUN apt-get install --no-install-recommends -y build-essential && \ + apt-get clean autoclean && \ + apt-get autoremove --yes && \ + rm -rf /var/lib/apt/lists/* && \ + mkdir -p /mnt/dokku/home/dokku /mnt/dokku/var/lib/dokku/config /mnt/dokku/var/lib/dokku/data /mnt/dokku/var/lib/dokku/services && \ + chown -R dokku:dokku /mnt/dokku/home/dokku /mnt/dokku/var/lib/dokku/config /mnt/dokku/var/lib/dokku/data /mnt/dokku/var/lib/dokku/services && \ + echo "dokku.me" > /home/dokku/VHOST + +COPY . . + +RUN source /tmp/config && \ + echo "export ${PLUGIN_DISABLE_PULL_VARIABLE}=true" > /tmp/.env && \ + echo "export PLUGIN_NAME=${PLUGIN_COMMAND_PREFIX}" >> /tmp/.env + +RUN source /tmp/.env && \ + dokku plugin:install file:///tmp --name $PLUGIN_NAME && \ + make ci-dependencies diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..ad65693 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,8 @@ +{ + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + "runArgs": ["--init"], + "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ] +}