Skip to content

Commit 16222c8

Browse files
committed
Add devcontainer
1 parent b8587c0 commit 16222c8

6 files changed

Lines changed: 113 additions & 1 deletion

File tree

‎.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,4 +350,3 @@ MigrationBackup/
350350

351351
.idea
352352
.DS_Store
353-
.devcontainer

‎docs/.devcontainer/Dockerfile‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# [Choice] Debian OS version (use bullseye on local arm64/Apple Silicon): bullseye, buster
2+
ARG VARIANT=bullseye
3+
FROM mcr.microsoft.com/vscode/devcontainers/jekyll:0-${VARIANT}
4+
5+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
6+
ARG NODE_VERSION="none"
7+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
8+
9+
# [Optional] Uncomment this section to install additional OS packages.
10+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
11+
# && apt-get -y install --no-install-recommends <your-package-list-here>
12+
13+
# [Optional] Uncomment this line to install global node packages.
14+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

‎docs/.devcontainer/base.Dockerfile‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# [Choice] Debian OS version (use 2.7-bullseye on local arm64/Apple Silicon): 2.7-bullseye, 2.7-buster
2+
ARG VARIANT=2.7-bullseye
3+
FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT}
4+
COPY library-scripts/meta.env /usr/local/etc/vscode-dev-containers
5+
6+
# ENV Variables required by Jekyll
7+
ENV LANG=en_US.UTF-8 \
8+
LANGUAGE=en_US:en \
9+
TZ=Etc/UTC \
10+
LC_ALL=en_US.UTF-8 \
11+
LANG=en_US.UTF-8 \
12+
LANGUAGE=en_US
13+
14+
# Install bundler, latest jekyll, and github-pages for older jekyll
15+
RUN gem install bundler jekyll github-pages
16+
17+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
18+
ARG NODE_VERSION="none"
19+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
20+
21+
# [Optional] Uncomment this section to install additional OS packages.
22+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
23+
# && apt-get -y install --no-install-recommends <your-package-list-here>
24+
25+
# [Optional] Uncomment this line to install global node packages.
26+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/jekyll
3+
{
4+
"name": "Jekyll",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"args": {
8+
// Update 'VARIANT' to pick a Debian OS version: bullseye, buster
9+
// Use bullseye when on local arm64/Apple Silicon.
10+
"VARIANT": "bullseye",
11+
// Enable Node.js: pick the latest LTS version
12+
"NODE_VERSION": "lts/*"
13+
}
14+
},
15+
16+
// Set *default* container specific settings.json values on container create.
17+
"settings": {},
18+
19+
// Add the IDs of extensions you want installed when the container is created.
20+
"extensions": [],
21+
22+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
23+
"forwardPorts": [
24+
// Jekyll server
25+
4000,
26+
// Live reload server
27+
35729
28+
],
29+
30+
// Use 'postCreateCommand' to run commands after the container is created.
31+
"postCreateCommand": "sh .devcontainer/post-create.sh",
32+
33+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
34+
"remoteUser": "vscode"
35+
}

‎docs/.devcontainer/post-create.sh‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
# Install the version of Bundler.
4+
if [ -f Gemfile.lock ] && grep "BUNDLED WITH" Gemfile.lock > /dev/null; then
5+
cat Gemfile.lock | tail -n 2 | grep -C2 "BUNDLED WITH" | tail -n 1 | xargs gem install bundler -v
6+
fi
7+
8+
# If there's a Gemfile, then run `bundle install`
9+
# It's assumed that the Gemfile will install Jekyll too
10+
if [ -f Gemfile ]; then
11+
bundle install
12+
fi

‎docs/.vscode/tasks.json‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "Serve",
8+
"type": "shell",
9+
"command": "bundle exec jekyll serve --livereload",
10+
"group": {
11+
"kind": "test",
12+
"isDefault": true
13+
},
14+
"isBackground": true,
15+
},
16+
{
17+
"label": "Build",
18+
"type": "shell",
19+
"command": "bundle exec jekyll build",
20+
"group": {
21+
"kind": "build",
22+
"isDefault": true
23+
},
24+
}
25+
]
26+
}

0 commit comments

Comments
 (0)