Skip to content

Commit 1cf1c51

Browse files
authored
Merge pull request #366 from abkfenris/devcontainer
Add devcontainer
2 parents 6612032 + 5cc005d commit 1cf1c51

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM mcr.microsoft.com/devcontainers/base:jammy
2+
3+
ARG PIXI_VERSION=v0.51.0
4+
5+
RUN curl -L -o /usr/local/bin/pixi -fsSL --compressed "https://github.com/prefix-dev/pixi/releases/download/${PIXI_VERSION}/pixi-$(uname -m)-unknown-linux-musl" \
6+
&& chmod +x /usr/local/bin/pixi \
7+
&& pixi info
8+
9+
# set some user and workdir settings to work nicely with vscode
10+
USER vscode
11+
WORKDIR /home/vscode
12+
13+
RUN echo 'eval "$(pixi completion -s bash)"' >> /home/vscode/.bashrc

.devcontainer/devcontainer.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "my-project",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "..",
6+
},
7+
"customizations": {
8+
"vscode": {
9+
"settings": {},
10+
"extensions": ["ms-python.python", "charliermarsh.ruff", "GitHub.copilot"]
11+
},
12+
"codespaces": {
13+
"openFiles": [
14+
"README.md",
15+
"_InstructionSiteUpdates.md"
16+
]
17+
}
18+
},
19+
"features": {
20+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
21+
},
22+
"mounts": ["source=${localWorkspaceFolderBasename}-pixi,target=${containerWorkspaceFolder}/.pixi,type=volume"],
23+
"postCreateCommand": "sudo chown vscode .pixi && pixi install"
24+
}

.vscode/tasks.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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": "html",
8+
"type": "shell",
9+
"command": "pixi run html",
10+
"group": {
11+
"kind": "build",
12+
"isDefault": false
13+
}
14+
},
15+
{
16+
"label": "clean",
17+
"type": "shell",
18+
"command": "pixi run clean",
19+
"group": {
20+
"kind": "build",
21+
"isDefault": false
22+
}
23+
},
24+
{
25+
"label": "live",
26+
"type": "shell",
27+
"command": "pixi run live",
28+
"group": {
29+
"kind": "build",
30+
"isDefault": true
31+
}
32+
}
33+
]
34+
}

0 commit comments

Comments
 (0)