Skip to content

Commit 4f42225

Browse files
authored
Chore: devcontainer (#111)
2 parents acf10e7 + 305b40f commit 4f42225

File tree

166 files changed

+261
-40
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+261
-40
lines changed

.devcontainer/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM python:3.11
2+
3+
ENV PYTHONDONTWRITEBYTECODE=1 \
4+
PYTHONUNBUFFERED=1 \
5+
USER=compiler
6+
7+
RUN apt-get update
8+
RUN apt-get install -y ruby-full && gem install bundler
9+
RUN python -m pip install --upgrade pip
10+
11+
RUN useradd --create-home --shell /bin/bash $USER && \
12+
chown -R $USER /home/$USER
13+
14+
WORKDIR /home/$USER/site
15+
16+
COPY Gemfile Gemfile
17+
COPY Gemfile.lock Gemfile.lock
18+
RUN bundle install
19+
20+
USER $USER
21+
ENV PATH "$PATH:/home/$USER/.local/bin"
22+
23+
COPY .devcontainer/requirements.txt .devcontainer/requirements.txt
24+
RUN pip install --no-cache-dir -r .devcontainer/requirements.txt

.devcontainer/compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
site:
3+
build:
4+
context: ..
5+
dockerfile: .devcontainer/Dockerfile
6+
command: sleep infinity
7+
volumes:
8+
- ..:/home/compiler/site

.devcontainer/devcontainer.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "compiler/datadonuts.la",
3+
"dockerComposeFile": "compose.yml",
4+
"service": "site",
5+
"workspaceFolder": "/home/compiler/site",
6+
"postAttachCommand": ["/bin/bash", ".devcontainer/postAttach.sh"],
7+
"customizations": {
8+
"vscode": {
9+
"settings": {
10+
"terminal.integrated.defaultProfile.linux": "bash",
11+
"terminal.integrated.profiles.linux": {
12+
"bash": {
13+
"path": "/bin/bash"
14+
}
15+
}
16+
},
17+
"extensions": [
18+
"eamodio.gitlens",
19+
"esbenp.prettier-vscode",
20+
"mhutchie.git-graph",
21+
"redhat.vscode-xml",
22+
"sissel.shopify-liquid",
23+
"tamasfe.even-better-toml"
24+
]
25+
}
26+
}
27+
}

.devcontainer/postAttach.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
git config --global --add safe.directory /home/compiler/site
5+
6+
# initialize hook environments
7+
pre-commit install --install-hooks --overwrite
8+
9+
# manage commit-msg hooks
10+
pre-commit install --hook-type commit-msg

.devcontainer/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pre-commit

.github/dependabot.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "bundler" # See documentation for possible values
9+
directory: "/" # Location of Gemfile
10+
schedule:
11+
interval: "daily"
12+
commit-message:
13+
prefix: "chore"
14+
include: "scope"
15+
labels:
16+
- "dependencies"
17+
- package-ecosystem: "github-actions"
18+
# Workflow files stored in the
19+
# default location of `.github/workflows`
20+
directory: "/"
21+
schedule:
22+
interval: "daily"
23+
commit-message:
24+
prefix: "chore"
25+
include: "scope"
26+
labels:
27+
- "dependencies"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
.jekyll-metadata
33
.idea/
44
_site/
5-
.DS_Store
5+
.DS_Store

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ci:
2+
autofix_commit_msg: "chore(pre-commit): autofix run"
3+
autoupdate_commit_msg: "chore(pre-commit): autoupdate hooks"
4+
5+
default_install_hook_types:
6+
- pre-commit
7+
- commit-msg
8+
9+
repos:
10+
- repo: https://github.com/compilerla/conventional-pre-commit
11+
rev: v3.4.0
12+
hooks:
13+
- id: conventional-pre-commit
14+
stages: [commit-msg]
15+
16+
- repo: https://github.com/pre-commit/pre-commit-hooks
17+
rev: v4.6.0
18+
hooks:
19+
- id: trailing-whitespace
20+
- id: mixed-line-ending
21+
- id: end-of-file-fixer
22+
- id: requirements-txt-fixer
23+
- id: check-yaml
24+
args: ["--unsafe"]
25+
- id: check-added-large-files

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"printWidth": 120
5+
}

.vscode/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"files.encoding": "utf8",
5+
"files.eol": "\n",
6+
"files.insertFinalNewline": true,
7+
"files.trimFinalNewlines": true,
8+
"files.trimTrailingWhitespace": true,
9+
"editor.tabSize": 2,
10+
"files.associations": {
11+
"*.html": "liquid"
12+
},
13+
"[liquid]": {
14+
"editor.defaultFormatter": "sissel.shopify-liquid"
15+
}
16+
}

0 commit comments

Comments
 (0)