diff options
| author | Kevin J Hoerr <kjhoerr@protonmail.com> | 2021-09-20 20:35:13 +0000 |
|---|---|---|
| committer | Kevin J Hoerr <kjhoerr@protonmail.com> | 2021-09-20 20:35:13 +0000 |
| commit | d339ce2b919477411a0339cfc6004f0e66eaee55 (patch) | |
| tree | 00f34fe903982f8c70d5f5df1b8bd3f434034fe3 | |
| parent | f830bab4ec14f3fe814962a6a2dee180149c3a6a (diff) | |
| download | ao-coverage-d339ce2b919477411a0339cfc6004f0e66eaee55.tar.gz ao-coverage-d339ce2b919477411a0339cfc6004f0e66eaee55.tar.bz2 ao-coverage-d339ce2b919477411a0339cfc6004f0e66eaee55.zip | |
ARGify HOST_DIR for devcontainer
| -rw-r--r-- | .devcontainer/Dockerfile | 10 | ||||
| -rw-r--r-- | .devcontainer/docker-compose.yml | 8 | ||||
| -rw-r--r-- | .dockerignore | 1 | ||||
| -rw-r--r-- | .gitignore | 1 |
4 files changed, 13 insertions, 7 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4765d2d..eae9427 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -21,7 +21,9 @@ 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" ] +# create host directory for reports and assign it to a volume +ARG HOST_DIR=/dist +RUN mkdir -p $HOST_DIR +RUN chown $USER_UID:$USER_GID $HOST_DIR +VOLUME [ "${HOST_DIR}" ] +ENV HOST_DIR=${HOST_DIR} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 0e637d0..a423754 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -10,15 +10,17 @@ services: USER_UID: 1000 USER_GID: 1000 + # Volume directory for hosted files. This directory is created in the Dockerfile with proper permissions. This is set as an env-var in the Dockerfile + HOST_DIR: /dist + + # Place env var changes in this file (`.devcontainer/devcontainer.env`) to persist them without tracking/staging changes + env_file: devcontainer.env environment: # port and bind info PORT: 3000 BIND_ADDRESS: localhost TARGET_URL: http://localhost:3000 - # Volume directory for hosted files. This directory is already created and has proper permissions - HOST_DIR: /dist - # DB info MONGO_URI: mongodb://db:27017 MONGO_DB: ao-coverage diff --git a/.dockerignore b/.dockerignore index e0c277d..b75bea1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ +.devcontainer .git .vscode build @@ -5,6 +5,7 @@ coverage docs .vscode tsconfig.tsbuildinfo +.devcontainer/devcontainer.env .env* !.env.sample .yarn/* |
