| FROM apify/actor-node-playwright-chrome:20 | |
| RUN useradd -m -u 1003 user | |
| WORKDIR /app | |
| # Install Bun locally (non-root, Apify-safe) | |
| RUN curl -fsSL https://bun.sh/install | bash | |
| USER user | |
| ENV PATH="/home/user/.bun/bin:$PATH" | |
| # WORKDIR /home/myuser | |
| # Copy everything INCLUDING dist/ | |
| COPY --chown=user . ./ | |
| # Install production deps only | |
| RUN bun install --production | |
| ENV APP_ENV="prod" | |
| ENV NODE_TLS_REJECT_UNAUTHORIZED="0" | |
| ENV NODE_ENV=production | |
| EXPOSE 7860 | |
| # Run prebuilt output | |
| CMD ./start_xvfb_and_run_cmd.sh && bun run start:prod:tsdown | |