diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6f7e4ae61..83191fc7d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,8 +8,12 @@ "ghcr.io/rails/devcontainer/features/activestorage": {}, "ghcr.io/itsmechlark/features/redis-server:1": {} }, - "postCreateCommand": "sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install libpq-dev libmariadb-dev libarchive13 -y && export COREPACK_ENABLE_DOWNLOAD_PROMPT=0 && corepack enable && bundle install && yarn install", - "postStartCommand": "bash ./bin/dev", + "initializeCommand": "mkdir -p ${localEnv:HOME}/manyfold-data", + "mounts": [ + "source=${localEnv:HOME}/manyfold-data,target=/libraries,type=bind,consistency=cached" + ], + "postCreateCommand": "bash .devcontainer/setup.sh", + "postStartCommand": "redis-server --daemonize yes && bash ./bin/dev", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100644 index 000000000..f137560d4 --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Install System packages +sudo apt-get update +sudo apt-get upgrade -y +sudo apt-get install -y \ + libpq-dev \ + libmariadb-dev \ + libarchive13 \ + libassimp-dev \ + f3d + +# JS toolchain +export COREPACK_ENABLE_DOWNLOAD_PROMPT=0 +corepack enable + +# Ruby / JS dependencies +bundle install +yarn install