Files
docker-compose/.archived/vaultwarden/compose.yaml
T

72 lines
2.6 KiB
YAML
Raw Normal View History

2025-07-14 12:48:15 +05:30
# Vaultwarden Configuration - (Bitwarden-compatible) Password Manager
2025-07-08 13:22:22 +05:30
services:
vaultwarden_db:
2025-07-14 12:48:15 +05:30
# PostgreSQL Database Configuration
2025-07-08 13:22:22 +05:30
container_name: vaultwarden_db
2025-07-13 18:35:45 +05:30
image: docker.io/library/postgres:17.5
2025-07-14 12:48:15 +05:30
restart: unless-stopped # Auto-recover from crashes
# Database credentials
2025-07-08 13:22:22 +05:30
environment:
2025-07-14 12:48:15 +05:30
- POSTGRES_USER=${POSTGRES_USER} # Database username
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} # Database password
- POSTGRES_DB=${POSTGRES_DB} # Database name
# Persistent storage configuration
2025-07-08 13:22:22 +05:30
volumes:
2025-07-14 12:48:15 +05:30
- ${APPDATA_PATH}/vaultwarden/db:/var/lib/postgresql/data # Database files
# Network configuration
2025-07-08 13:22:22 +05:30
ports:
2025-07-14 12:48:15 +05:30
- ${DB_PORT}:5432 # PostgreSQL default port
2025-07-08 16:40:16 +05:30
networks:
2025-07-14 12:48:15 +05:30
- backend # Connects to backend network
# Health monitoring
2025-07-08 13:22:22 +05:30
healthcheck:
2025-07-14 12:48:15 +05:30
test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"] # Connection check
interval: 30s # Check every 30 seconds
timeout: 5s # Maximum check duration
retries: 5 # Allow 5 failures before marking unhealthy
start_period: 20s # Initial grace period
2025-07-08 13:22:22 +05:30
vaultwarden_server:
container_name: vaultwarden_server
2025-07-14 12:48:15 +05:30
# Container configuration
image: ghcr.io/dani-garcia/vaultwarden:1.34.1 # Official Vaultwarden image
restart: unless-stopped # Auto-restart on failure
2025-07-08 13:22:22 +05:30
depends_on:
vaultwarden_db:
2025-07-14 12:48:15 +05:30
condition: service_healthy # Wait for healthy database
# Application settings
2025-07-08 13:22:22 +05:30
environment:
2025-07-14 12:48:15 +05:30
- PUID=${PUID} # User ID for file permissions
- PGID=${PGID} # Group ID for file permissions
- TZ=${TZ} # Timezone configuration
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@vaultwarden_db:5432/${POSTGRES_DB} # DB connection
- WEBSOCKET_ENABLED=${WEBSOCKET_ENABLED} # Real-time updates
- LOG_FILE=/data/vaultwarden.log # Log file location
2025-07-13 18:35:45 +05:30
# Uncomment and set these only on first run
2025-07-14 12:48:15 +05:30
# - DOMAIN=${DOMAIN} # Domain Name
# - SIGNUPS_ALLOWED=${SIGNUPS_ALLOWED} # User registration
# - ADMIN_TOKEN=${ADMIN_TOKEN} # Admin interface access token
# Persistent storage configuration
2025-07-08 13:22:22 +05:30
volumes:
2025-07-14 12:48:15 +05:30
- ${APPDATA_PATH}/vaultwarden/data:/data # Vault data storage
# Network configuration
2025-07-08 13:22:22 +05:30
ports:
2025-07-14 12:48:15 +05:30
- ${SERVER_PORT}:80 # Web interface port
2025-07-08 16:40:16 +05:30
networks:
2025-07-14 12:48:15 +05:30
- frontend # Connects to frontend network
- backend # Connects to backend network
2025-07-08 16:40:16 +05:30
2025-07-14 12:48:15 +05:30
# External network definitions
2025-07-08 16:40:16 +05:30
networks:
frontend:
2025-07-14 12:48:15 +05:30
external: true # Uses existing frontend network
2025-07-08 16:40:16 +05:30
backend:
2025-07-14 12:48:15 +05:30
external: true # Uses existing backend network