FROM oven/bun:1.2.22-alpine
ARG ALPINE_REPOSITORY=
RUN if [ -n "$ALPINE_REPOSITORY" ]; then printf '%s\n' "$ALPINE_REPOSITORY/main" "$ALPINE_REPOSITORY/community" > /etc/apk/repositories; fi
RUN apk add --no-cache bash docker-cli docker-cli-compose openssh-client
WORKDIR /app/src/components/provider-gateway
COPY src/components/provider-gateway/package.json ./package.json
RUN bun install --production
COPY src/components/shared /app/src/components/shared
COPY src/components/provider-gateway/src ./src
COPY src/components/provider-gateway/scripts/host-ssh-shell.sh /usr/local/bin/unidesk-host-ssh-shell
RUN chmod +x /usr/local/bin/unidesk-host-ssh-shell
CMD ["bun", "run", "src/index.ts"]
