Skip to content

Commit

Permalink
Update devcontainer config (#350)
Browse files Browse the repository at this point in the history
* another update

* Update container version

* Update Dockerfile

* Update devcontainer.json

* Update welcome-message.txt

* Update welcome-message.txt
  • Loading branch information
Adammatthiesen authored Oct 7, 2024
1 parent c50379a commit 56c436b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
16 changes: 11 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
FROM mcr.microsoft.com/devcontainers/javascript-node:0-20
FROM mcr.microsoft.com/devcontainers/javascript-node:1-20@sha256:f28172ab4f8cf57dacadc4d2aecf6d108bd9881617bd133b16ddcff6e6eef340

# We uninstall pnpm here, since we enable the corepack version in the postCreateCommand
# This ensures we respect the "packageManager" version in package.json
RUN npm uninstall -g pnpm && nvm install 20.14.0
# Enable Proto
RUN curl -fsSL https://moonrepo.dev/install/proto.sh | bash -s -- --yes

COPY welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt
# Change default Node version
RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install 20.14.0"

# Enable corepack (incase proto fails)
RUN corepack enable pnpm

# Copy welcome message
COPY welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt
5 changes: 1 addition & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
"build": {
"dockerfile": "Dockerfile"
},
"postCreateCommand": "sudo corepack enable pnpm && pnpm config set store-dir /home/node/.pnpm-store && PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 pnpm install",
"postCreateCommand": "pnpm config set store-dir /home/node/.pnpm-store && PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 pnpm install",
"waitFor": "postCreateCommand",
"customizations": {
"codespaces": {
"openFiles": ["README.md"]
},
"vscode": {
"extensions": [
"astro-build.astro-vscode",
Expand Down
7 changes: 6 additions & 1 deletion .devcontainer/welcome-message.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
👋 Welcome to StudioCMS!

🛠️ Your environment is fully setup with all required software installed.
🛠️ To get started, run the following commands:
- `cd studiocms/`
- `proto install` - ProtoCLI will install and ensure correct versions for all engines and package managers
- `pnpm install` - Install all dependencies for the monorepo

🎉 The monorepo will then be ready to develop

0 comments on commit 56c436b

Please sign in to comment.