From 79952457ec8bdfa774dedd2de7cc143a2b5851cf Mon Sep 17 00:00:00 2001 From: icyleaf Date: Wed, 22 May 2024 15:40:40 +0000 Subject: [PATCH] chore: refactor devcontainer post-install --- .devcontainer/Dockerfile | 1 - .devcontainer/Dockerfile.base | 7 +++++++ .devcontainer/devcontainer.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2bb707c40..15701a0d7 100755 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,4 +2,3 @@ FROM ghcr.io/tryzealot/codespace:latest COPY . /workspace -RUN bundle install && yarn install diff --git a/.devcontainer/Dockerfile.base b/.devcontainer/Dockerfile.base index 45d577f97..794b876a2 100644 --- a/.devcontainer/Dockerfile.base +++ b/.devcontainer/Dockerfile.base @@ -66,3 +66,10 @@ WORKDIR /workspace RUN gem install bundler foreman && \ npm install --global yarn sass esbuild + +COPY Gemfile Gemfile.lock package.json ./ +USER root +RUN chmod a+w Gemfile.lock && mkdir node_modules && chown -R vscode:vscode /workspace +USER vscode + +RUN bundle install && yarn install diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 66a25d2e6..294385efd 100755 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -50,5 +50,5 @@ }, // (Optinal) Database migration. - "postCreateCommand": "rails zealot:upgrade && yarn install" + "postCreateCommand": "rails zealot:upgrade" }