chore(devcontainer): adapt to docker compose, add valkey service

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-07-04 17:28:52 +00:00
parent 06b2dca7fc
commit ded9c32801
3 changed files with 33 additions and 14 deletions

View File

@@ -6,7 +6,9 @@ COPY go.mod go.sum package.json package-lock.json ./
RUN go install github.com/a-h/templ/cmd/templ \ RUN go install github.com/a-h/templ/cmd/templ \
&& npx --yes playwright@1.52.0 install --with-deps\ && npx --yes playwright@1.52.0 install --with-deps\
&& apt-get update \ && apt-get update \
&& apt-get -y install zstd brotli \ && apt-get -y install zstd brotli redis \
&& mkdir -p /home/vscode/.local/share/fish \ && mkdir -p /home/vscode/.local/share/fish \
&& chown -R vscode:vscode /home/vscode/.local/share/fish \ && chown -R vscode:vscode /home/vscode/.local/share/fish \
&& chown -R vscode:vscode /go && chown -R vscode:vscode /go
CMD ["/usr/bin/sleep", "infinity"]

View File

@@ -3,13 +3,16 @@
{ {
"name": "Dev", "name": "Dev",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"build": { // "build": {
"dockerfile": "./Dockerfile", // "dockerfile": "./Dockerfile",
"context": "..", // "context": "..",
"cacheFrom": [ // "cacheFrom": [
"type=registry,ref=ghcr.io/techarohq/anubis/devcontainer" // "type=registry,ref=ghcr.io/techarohq/anubis/devcontainer"
] // ]
}, // },
"dockerComposeFile": ["./docker-compose.yaml"],
"service": "workspace",
"workspaceFolder": "/workspace/anubis",
"postStartCommand": "npm ci && go mod download", "postStartCommand": "npm ci && go mod download",
"features": { "features": {
"ghcr.io/xe/devcontainer-features/ko:1.1.0": {} "ghcr.io/xe/devcontainer-features/ko:1.1.0": {}
@@ -27,8 +30,5 @@
] ]
} }
}, },
"forwardPorts": [ "forwardPorts": [8923, 3000]
8923, }
3000
]
}

View File

@@ -0,0 +1,17 @@
services:
valkey:
image: valkey/valkey:8
pull_policy: always
# VS Code workspace service
workspace:
image: ghcr.io/techarohq/anubis/devcontainer
build:
context: ..
dockerfile: .devcontainer/Dockerfile
cache_from:
- "type=registry,ref=ghcr.io/techarohq/anubis/devcontainer"
volumes:
- ../:/workspace/anubis:cached
#entrypoint: ["/usr/bin/sleep", "infinity"]
user: vscode