|
| 1 | +{ |
| 2 | + "name": "go-sqlcmd Development", |
| 3 | + "dockerComposeFile": "docker-compose.yml", |
| 4 | + "service": "devcontainer", |
| 5 | + "workspaceFolder": "/workspaces/go-sqlcmd", |
| 6 | + "shutdownAction": "stopCompose", |
| 7 | + |
| 8 | + // Configure tool-specific properties |
| 9 | + "customizations": { |
| 10 | + "vscode": { |
| 11 | + "extensions": [ |
| 12 | + "golang.go", |
| 13 | + "ms-mssql.mssql", |
| 14 | + "ms-azuretools.vscode-docker", |
| 15 | + "GitHub.copilot", |
| 16 | + "GitHub.copilot-chat", |
| 17 | + "eamodio.gitlens", |
| 18 | + "EditorConfig.EditorConfig", |
| 19 | + "streetsidesoftware.code-spell-checker" |
| 20 | + ], |
| 21 | + "settings": { |
| 22 | + "go.toolsManagement.autoUpdate": false, |
| 23 | + "go.useLanguageServer": true, |
| 24 | + "go.lintTool": "golangci-lint", |
| 25 | + "go.lintFlags": ["--fast"], |
| 26 | + "go.testEnvVars": { |
| 27 | + "SQLCMDSERVER": "localhost", |
| 28 | + "SQLCMDUSER": "sa", |
| 29 | + "SQLCMDPASSWORD": "${env:SQLCMDPASSWORD}", |
| 30 | + "SQLCMDDATABASE": "master" |
| 31 | + }, |
| 32 | + "mssql.connections": [ |
| 33 | + { |
| 34 | + "server": "localhost,1433", |
| 35 | + "database": "master", |
| 36 | + "authenticationType": "SqlLogin", |
| 37 | + "user": "sa", |
| 38 | + "password": "", |
| 39 | + "savePassword": false, |
| 40 | + "profileName": "sqlcmd-container (use SQLCMDPASSWORD env var)", |
| 41 | + "encrypt": "Optional", |
| 42 | + "trustServerCertificate": true |
| 43 | + } |
| 44 | + ], |
| 45 | + "editor.formatOnSave": true, |
| 46 | + "editor.defaultFormatter": "golang.go", |
| 47 | + "[go]": { |
| 48 | + "editor.formatOnSave": true, |
| 49 | + "editor.codeActionsOnSave": { |
| 50 | + "source.organizeImports": "explicit" |
| 51 | + } |
| 52 | + }, |
| 53 | + "terminal.integrated.defaultProfile.linux": "bash" |
| 54 | + } |
| 55 | + } |
| 56 | + }, |
| 57 | + |
| 58 | + // Forward the SQL Server port |
| 59 | + "forwardPorts": [1433], |
| 60 | + "portsAttributes": { |
| 61 | + "1433": { |
| 62 | + "label": "SQL Server", |
| 63 | + "onAutoForward": "silent" |
| 64 | + } |
| 65 | + }, |
| 66 | + |
| 67 | + // Use 'postCreateCommand' to run commands after the container is created |
| 68 | + "postCreateCommand": "bash .devcontainer/post-create.sh", |
| 69 | + |
| 70 | + // Environment variables for tests - password must match docker-compose.yml |
| 71 | + // This is a development-only container credential, not a production secret. |
| 72 | + // For GitHub Codespaces, you can override SQLCMDPASSWORD via Codespaces Secrets. |
| 73 | + "remoteEnv": { |
| 74 | + "SQLCMDSERVER": "localhost", |
| 75 | + "SQLCMDUSER": "sa", |
| 76 | + "SQLCMDPASSWORD": "${localEnv:SQLCMDPASSWORD:SqlCmd@2025!}", |
| 77 | + "SQLCMDDATABASE": "master", |
| 78 | + "SQLCMDDBNAME": "master" |
| 79 | + }, |
| 80 | + |
| 81 | + // Features to add to the dev container |
| 82 | + "features": { |
| 83 | + "ghcr.io/devcontainers/features/docker-in-docker:2": { |
| 84 | + "moby": true |
| 85 | + }, |
| 86 | + "ghcr.io/devcontainers/features/github-cli:1": {} |
| 87 | + } |
| 88 | +} |
0 commit comments