diff options
| author | Kevin J Hoerr <kjhoerr@protonmail.com> | 2021-09-17 21:35:11 +0000 |
|---|---|---|
| committer | Kevin J Hoerr <kjhoerr@protonmail.com> | 2021-09-17 21:35:11 +0000 |
| commit | 3edc57fa22ad378826c1ed35f2cb0e6d657a20d4 (patch) | |
| tree | 49080bb4f0fc70bf112d0fb70df7ab9f0e4600f5 /.devcontainer/Dockerfile | |
| parent | 424a95e0ac4a43b53cf4660a5785b5d1115cc3a6 (diff) | |
| download | ao-coverage-3edc57fa22ad378826c1ed35f2cb0e6d657a20d4.tar.gz ao-coverage-3edc57fa22ad378826c1ed35f2cb0e6d657a20d4.tar.bz2 ao-coverage-3edc57fa22ad378826c1ed35f2cb0e6d657a20d4.zip | |
Add devcontainer files
Diffstat (limited to '.devcontainer/Dockerfile')
| -rw-r--r-- | .devcontainer/Dockerfile | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..4765d2d --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,27 @@ +# MongoDB doesn't provide devtools for Debian, so we adapt Ubuntu to use nodejs and MongoDB +FROM ubuntu:bionic + +# Install needed packages, yarn, nvm and setup non-root user +RUN groupadd --gid 1000 node \ + && useradd --uid 1000 --gid node --shell /bin/bash --create-home node +COPY node.sh ./ +RUN chmod +x ./node.sh +RUN ./node.sh + +# Install MongoDB command line tools +ARG MONGO_TOOLS_VERSION=4.2 +RUN curl -sSL "https://www.mongodb.org/static/pgp/server-${MONGO_TOOLS_VERSION}.asc" | (OUT=$(apt-key add - 2>&1) || echo $OUT) \ + && echo "deb http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/${MONGO_TOOLS_VERSION} multiverse" | tee /etc/apt/sources.list.d/mongodb-org-${MONGO_TOOLS_VERSION}.list \ + && apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get install -y mongodb-org-tools mongodb-org-shell \ + && apt-get clean -y && rm -rf /var/lib/apt/lists/* + +# Update args in docker-compose.yaml to set the UID/GID of the "node" user +ARG USER_UID=1000 +ARG USER_GID=$USER_UID +RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then groupmod --gid $USER_GID node && usermod --uid $USER_UID --gid $USER_GID node; fi + +# create /dist and assign it to a volume +RUN mkdir -p /dist +RUN chown $USER_UID:$USER_GID /dist +VOLUME [ "/dist" ] |
