mirror of
https://github.com/bitwarden/browser
synced 2026-02-15 16:05:03 +00:00
Added devcontainer setup (devcontainer.json, docker-compose.yml, postCreateCommand.sh)
This commit is contained in:
41
.devcontainer/devcontainer.json
Normal file
41
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "Bitwarden Clients",
|
||||
"dockerComposeFile": "docker-compose.yml",
|
||||
"service": "bitwarden_clients",
|
||||
"workspaceFolder": "/workspace",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/rust:1": {}
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"settings": {},
|
||||
"extensions": [
|
||||
"angular.ng-template",
|
||||
"orta.vscode-jest",
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"nrwl.angular-console",
|
||||
"bradlc.vscode-tailwindcss"
|
||||
]
|
||||
}
|
||||
},
|
||||
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh",
|
||||
"forwardPorts": [8080, 8081, 6006],
|
||||
"portsAttributes": {
|
||||
"default": {
|
||||
"onAutoForward": "ignore"
|
||||
},
|
||||
"8080": {
|
||||
"label": "Web Vault",
|
||||
"onAutoForward": "notify"
|
||||
},
|
||||
"8081": {
|
||||
"label": "Web Vault (Self-hosted)",
|
||||
"onAutoForward": "notify"
|
||||
},
|
||||
"6006": {
|
||||
"label": "Storybook",
|
||||
"onAutoForward": "notify"
|
||||
}
|
||||
}
|
||||
}
|
||||
8
.devcontainer/docker-compose.yml
Normal file
8
.devcontainer/docker-compose.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
name: bitwarden_common
|
||||
|
||||
services:
|
||||
bitwarden_clients:
|
||||
image: mcr.microsoft.com/devcontainers/typescript-node:22
|
||||
volumes:
|
||||
- ../:/workspace:cached
|
||||
command: sleep infinity
|
||||
26
.devcontainer/postCreateCommand.sh
Executable file
26
.devcontainer/postCreateCommand.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "Running postCreateCommand.sh"
|
||||
|
||||
# Configure git safe directory
|
||||
git config --global --add safe.directory /workspace
|
||||
|
||||
# Install mkcert for SSL certificates (needed for WebAuthn)
|
||||
echo "Installing mkcert..."
|
||||
sudo apt-get update && sudo apt-get install -y libnss3-tools
|
||||
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
|
||||
chmod +x mkcert-v*-linux-amd64
|
||||
sudo mv mkcert-v*-linux-amd64 /usr/local/bin/mkcert
|
||||
|
||||
# Generate SSL certificates for localhost
|
||||
echo "Generating SSL certificates..."
|
||||
mkcert -install
|
||||
cd /workspace/apps/web
|
||||
mkcert -cert-file dev-server.local.pem -key-file dev-server.local.pem localhost bitwarden.test
|
||||
cd /workspace
|
||||
|
||||
# Install npm dependencies
|
||||
echo "Running npm ci..."
|
||||
npm ci
|
||||
|
||||
echo "postCreateCommand.sh completed"
|
||||
Reference in New Issue
Block a user