Compare commits

..

2 Commits

Author SHA1 Message Date
25fc35eb3a lll 2026-02-02 11:45:04 +03:00
cbfe2f80bc Add dev container config 2026-02-02 02:49:54 +00:00
4 changed files with 89 additions and 0 deletions

30
.devcontainer/Dockerfile Normal file
View File

@ -0,0 +1,30 @@
FROM golang:tip-alpine3.22
ARG PROJECT_NAME=learn
ARG USERNAME=vscode
ARG USER_ID=1000
ARG USER_GID=${USER_ID}
RUN apk update --no-cache && apk add --no-cache \
git \
curl \
wget \
unzip \
zsh \
&& rm -rf /var/lib/apt/lists/* \
&& go install github.com/go-delve/delve/cmd/dlv@latest \
&& go install -v golang.org/x/tools/gopls@latest \
&& addgroup -g ${USER_GID} ${USERNAME} \
&& adduser -D -u ${USER_ID} \
-G ${USERNAME} \
-s /bin/zsh \
${USERNAME} \
&& mkdir -p /home/$USERNAME/.vscode-server \
&& chown -R ${USER_ID}:${USER_ID} /home/${USERNAME}
USER ${USERNAME}
WORKDIR /srv/${PROJECT_NAME}
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

View File

@ -0,0 +1,57 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/go .
{
"name": "Go dev container",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// "image": "mcr.microsoft.com/devcontainers/go:2-1.25-trixie"
"build" : {
"dockerfile": "Dockerfile",
"options": [
"-t=godev"
]
},
"workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/app,type=bind,consistency=cached",
"workspaceFolder": "/home/vscode/app",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "go version",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.profiles.linux": {
"zsh (login)": {
"path": "zsh",
"icon": "terminal-linux",
"args": ["-l"]
}
},
"terminal.integrated.defaultProfile.linux": "zsh (login)"
},
"extensions": [
"golang.go",
"ms-vscode-remote.remote-containers",
"aaron-bond.better-comments",
"qwtel.sqlite-viewer",
"oderwat.indent-rainbow",
"jinliming2.vscode-go-template",
"tamasfe.even-better-toml",
"mechatroner.rainbow-csv",
"Gruntfuggly.todo-tree",
"eamodio.gitlens"
]
},
"extensions": [
]
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "vscode"
}

1
.vscode/launch.json vendored
View File

@ -5,6 +5,7 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "Launch Package", "name": "Launch Package",
"type": "go", "type": "go",

1
cmd/app/test Normal file
View File

@ -0,0 +1 @@
asdasd