summaryrefslogtreecommitdiffstats
path: root/.devcontainer/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to '.devcontainer/Dockerfile')
-rw-r--r--.devcontainer/Dockerfile30
1 files changed, 30 insertions, 0 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644
index 0000000..b8e9242
--- /dev/null
+++ b/.devcontainer/Dockerfile
@@ -0,0 +1,30 @@
+# Update the VARIANT arg in docker-compose.yml to pick a PHP version: 7, 7.4, 7.3
+ARG VARIANT=7
+FROM mcr.microsoft.com/vscode/devcontainers/php:${VARIANT}
+
+# Install MariaDB client
+RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
+ && apt-get install -y mariadb-client \
+ && apt-get clean -y && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/library-scripts
+
+# Update args in docker-compose.yaml to set the UID/GID of the "vscode" user.
+ARG USER_UID=1000
+ARG USER_GID=$USER_UID
+RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
+ groupmod --gid $USER_GID vscode \
+ && usermod --uid $USER_UID --gid $USER_GID vscode \
+ && chmod -R $USER_UID:$USER_GID /home/vscode \
+ && chmod -R $USER_UID:root /usr/local/share/nvm; \
+ fi
+
+# [Optional] Install a version of Node.js using nvm for front end dev
+ARG INSTALL_NODE="true"
+ARG NODE_VERSION="lts/*"
+RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
+
+# [Optional] Uncomment this section to install additional OS packages.
+# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
+# && apt-get -y install --no-install-recommends <your-package-list-here>
+
+# [Optional] Uncomment this line to install global node packages.
+# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1 \ No newline at end of file