Skip to content

Commit

Permalink
Adding devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
MattReimer committed Sep 20, 2024
1 parent 3b30021 commit b4b6b38
Show file tree
Hide file tree
Showing 12 changed files with 5,757 additions and 4,933 deletions.
23 changes: 23 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Dockerfile
FROM mcr.microsoft.com/devcontainers/typescript-node:0-18

# Install wget if not already installed
RUN apt-get update && apt-get install -y wget

# Install Gatsby CLI and Yarn
RUN npm install -g gatsby-cli yarn
# Let's get the latest version of Yarn
RUN corepack enable
RUN yarn set version berry

# Download .zshrc from remote address
# RUN sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
USER node
RUN wget https://raw.githubusercontent.com/Riverscapes/environment/master/nar-ys.zsh-theme -O ~/.oh-my-zsh/custom/themes/nar-ys.zsh-theme
RUN wget https://raw.githubusercontent.com/Riverscapes/environment/master/.aliases -O ~/.aliases
RUN wget https://raw.githubusercontent.com/Riverscapes/environment/master/.zshrc -O ~/.zshrc

# set memory to 8Gb so that Gatsby has a chance
ENV NODE_OPTIONS=--max-old-space-size=8192
ENV GATSBY_CPU_COUNT=2

36 changes: 36 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"dockerFile": "Dockerfile",
"name": "Gatsby Docs Dev Container",
"waitFor": "postCreateCommand",
// On container creation, install dependencies.
"postCreateCommand": "cd docs; yarn install",
// Build and run the dev site on container start.
"postAttachCommand": "cd docs; gatsby build; gatsby serve -H 0.0.0.0 -p 8000",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh"
},
"extensions": [
"GitHub.copilot",
"GitHub.copilot-chat",
"eriklynd.json-tools",
"yzhang.markdown-all-in-one",
"unifiedjs.vscode-mdx",
"dbaeumer.vscode-eslint",
"mhutchie.git-graph"
]
}
},
// Trigger actions on ports. More info: https://containers.dev/implementors/json_reference/#port-attributes
"portsAttributes": {
"8000": {
"label": "Application",
"onAutoForward": "openPreview"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
8000
]
}
3 changes: 3 additions & 0 deletions .github/workflows/pages-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
node-version-file: ./docs/.nvmrc
cache-dependency-path: ./docs/package.json
cache: yarn

- name: Get correct version of Yarn
run: corepack enable; yarn set version berry

- name: Setup Pages
id: pages
Expand Down
93 changes: 47 additions & 46 deletions Workspaces/QRiS_DEV.code-workspace
Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
{
"folders": [
{
"path": "..",
}
],
"settings": {
"[python]": {
"editor.tabSize": 4,
"editor.formatOnSave": true,
},
"files.exclude": {
"**/*.egg-info": true,
"**/__pycache__": true
},
"files.watcherExclude": {
"**/*.egg-info/**": true,
"**/__pycache__": true
},
"search.exclude": {
"**/*.egg-info": true,
"**/__pycache__": true
},
// FROM: https://gist.github.com/NicolaiMogensen/acfd8723720c4761aefef3cdfc2aa55a
// I like changing colors for my projects. QGIS projects are usually green.
"workbench.colorCustomizations": {
"titleBar.activeForeground": "#ffffff",
"titleBar.activeBackground": "#b4b4b473",
// "editor.background": "#1c2c2a"
},
"terminal.integrated.env.osx": {
"PYTHONPATH": "${env:QGIS_PATH}/Contents/Resources/python:${env:QGIS_PATH}/Contents/Resources/python/site-packages:${env:QGIS_PATH}/Contents/Resources/python/site-packages/PyQt5:${workspaceFolder}/wheels",
"PATH": "${env:PATH}:${env:QGIS_PATH}/Contents/MacOS/bin"
},
// NOTE: For this to work you need an env file with "QGIS_PATH=/Applications/QGIS-LTR.app/Contents" or whatever your path is
"folders": [
{
"path": "..",
}
],
"settings": {
"[python]": {
"editor.tabSize": 4,
"editor.formatOnSave": true,
},
"files.exclude": {
"**/*.egg-info": true,
"**/__pycache__": true
},
"files.watcherExclude": {
"**/*.egg-info/**": true,
"**/__pycache__": true
},
"search.exclude": {
"**/*.egg-info": true,
"**/__pycache__": true
},
// FROM: https://gist.github.com/NicolaiMogensen/acfd8723720c4761aefef3cdfc2aa55a
// I like changing colors for my projects. QGIS projects are usually green.
"workbench.colorCustomizations": {
"titleBar.activeForeground": "#ffffff",
"titleBar.activeBackground": "#b4b4b473",
// "editor.background": "#1c2c2a"
},
"terminal.integrated.env.osx": {
"PYTHONPATH": "${env:QGIS_PATH}/Contents/Resources/python:${env:QGIS_PATH}/Contents/Resources/python/site-packages:${env:QGIS_PATH}/Contents/Resources/python/site-packages/PyQt5:${workspaceFolder}/wheels",
"PATH": "${env:PATH}:${env:QGIS_PATH}/Contents/MacOS/bin"
},
// NOTE: For this to work you need an env file with "QGIS_PATH=/Applications/QGIS-LTR.app/Contents" or whatever your path is
"python.pythonPath": "${env:QGIS_PATH}/Contents/MacOS/bin/python3",
"qtForPython.uic.args": [
"-o \"${workspaceFolder}${pathSeparator}src${pathSeparator}view${pathSeparator}ui${pathSeparator}${fileBasenameNoExtension}.py\""
],
"qtForPython.rcc.args": [
"-o \"${workspaceFolder}${pathSeparator}src${pathSeparator}${fileBasenameNoExtension}.py\""
],
"qtForPython.rcc.liveExecution": false
},
"launch": {
"configurations": [],
"compounds": []
}
"qtForPython.uic.args": [
"-o \"${workspaceFolder}${pathSeparator}src${pathSeparator}view${pathSeparator}ui${pathSeparator}${fileBasenameNoExtension}.py\""
],
"qtForPython.rcc.args": [
"-o \"${workspaceFolder}${pathSeparator}src${pathSeparator}${fileBasenameNoExtension}.py\""
],
"qtForPython.rcc.liveExecution": false,
"terminal.integrated.defaultProfile.linux": "zsh"
},
"launch": {
"configurations": [],
"compounds": []
}
}
3 changes: 2 additions & 1 deletion Workspaces/QRiS_DOCS.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
},
"files.exclude": {
"**/node_modules/**": true
}
},
"terminal.integrated.defaultProfile.linux": "zsh"
},
"extensions": {
"recommendations": [
Expand Down
26 changes: 26 additions & 0 deletions docs/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "👷 Rebuild Gatsby Site",
"command": "yarn exec gatsby build",
"request": "launch",
"type": "node-terminal"
},
{
"name": "🗑️ Clean Gatsby Build",
"command": "yarn exec gatsby clean",
"request": "launch",
"type": "node-terminal"
},
{
"name": "📦 Upgrade Gatsby Theme",
"command": "yarn up @riverscapes/gatsby-theme",
"request": "launch",
"type": "node-terminal"
}
]
}
893 changes: 893 additions & 0 deletions docs/.yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions docs/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@riverscapes/template-clean",
"name": "@riverscapes/qris-docs",
"description": "Riverscapes website powered by Gatsby and Markdown",
"version": "1.0.0",
"private": true,
"license": "MIT",
"author": "Matt Reimer <matt@northarrowresearch.com>",
"dependencies": {
"@riverscapes/gatsby-theme": "^0.1.23",
"@riverscapes/gatsby-theme": "^0.1.24",
"gatsby": "^5.10.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
Loading

0 comments on commit b4b6b38

Please sign in to comment.