# CI-only Dockerfile: uses pre-built binaries from build-server job
# For local builds, use the standard Dockerfile instead
FROM node:22-bookworm-slim

ARG TARGETARCH

RUN apt-get update && apt-get install -y \
    libsqlite3-0 \
    git \
    openssh-client \
    ca-certificates \
    curl \
    python3 \
    python3-pip \
    && rm -rf /var/lib/apt/lists/*

COPY dist/${TARGETARCH}/codeg-server /usr/local/bin/codeg-server
COPY dist/web /app/web

ENV CODEG_STATIC_DIR=/app/web
ENV CODEG_DATA_DIR=/data
ENV CODEG_PORT=3080
ENV CODEG_HOST=0.0.0.0
ENV SHELL=/bin/bash

EXPOSE 3080
VOLUME /data

CMD ["codeg-server"]
