Bitwarden / Dockerfile
Antigravity Bot
deploy: Vaultwarden self-hosted Bitwarden on port 7860 with persistent /data
8e57c4a
Raw History Blame Contribute Delete
1.47 kB
# Vaultwarden on Hugging Face Spaces
# Port: 7860 (HF requirement)
# Data persistence via HF Dataset Storage mounted at /data
FROM vaultwarden/server:latest
# HF Spaces runs as non-root; vaultwarden needs write access to /data
USER root
# Install nginx as reverse proxy to map port 7860 -> 80
RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/*
# nginx config: forward :7860 -> vaultwarden :80
RUN cat > /etc/nginx/sites-available/default << 'EOF'
server {
listen 7860;
server_name _;
client_max_body_size 525M;
location / {
proxy_pass http://127.0.0.1:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /notifications/hub {
proxy_pass http://127.0.0.1:3012;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
EOF
# Entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Vaultwarden environment variables
ENV ROCKET_PORT=80
ENV WEBSOCKET_ENABLED=true
ENV WEBSOCKET_PORT=3012
ENV SIGNUPS_ALLOWED=true
ENV WEB_VAULT_ENABLED=true
ENV DATA_FOLDER=/data
ENV LOG_LEVEL=warn
ENV EXTENDED_LOGGING=false
# HF Spaces persistent storage is mounted at /data
VOLUME ["/data"]
EXPOSE 7860
ENTRYPOINT ["/entrypoint.sh"]