diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 7eb765d..7b81fa2 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -2,7 +2,9 @@ version: '3' services: silverstripe: - image: manuth/silverstripe-dev + build: + context: . + dockerfile: web.Dockerfile env_file: devcontainer.env environment: - SS_ENVIRONMENT_TYPE=dev diff --git a/.devcontainer/web.Dockerfile b/.devcontainer/web.Dockerfile new file mode 100644 index 0000000..2d0392a --- /dev/null +++ b/.devcontainer/web.Dockerfile @@ -0,0 +1,10 @@ +FROM manuth/silverstripe-dev + +RUN apt-get update && \ + apt-get -y install sudo && \ + rm -rf /var/lib/apt/lists/* + +RUN adduser --disabled-password --gecos '' vscode && \ + sed -i /etc/sudoers -re 's/^%sudo.*/%sudo ALL=(ALL:ALL) NOPASSWD: ALL/g' && \ + sed -i /etc/sudoers -re 's/^root.*/root ALL=(ALL:ALL) NOPASSWD: ALL/g' && \ + echo 'vscode ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers