FROM node:20-bookworm

RUN apt-get update
RUN apt-get install -y apt-transport-https git ca-certificates curl gnupg python3 python3-pip make build-essential mariadb-client wget zip unzip xz-utils

RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:${PATH}"

COPY .npmrc /root/.bun/install/global/.npmrc
RUN bun add -g @moduletrace/turbosync

COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

ENTRYPOINT ["entrypoint.sh"]
