FROM documenso/documenso:latest

# Switch to root to install packages
USER root

# Install Chromium and its dependencies
RUN apk add --no-cache     chromium     nss     freetype     harfbuzz     ca-certificates     ttf-freefont     openssl

# Create Playwright cache directory and symlink
RUN mkdir -p /home/nodejs/.cache/ms-playwright/chromium_headless_shell-1169/chrome-linux &&     ln -sf /usr/bin/chromium-browser /home/nodejs/.cache/ms-playwright/chromium_headless_shell-1169/chrome-linux/headless_shell &&     chown -R nodejs:nogroup /home/nodejs/.cache

# Switch back to nodejs user
USER nodejs

# Keep the original entrypoint
