# This docker image isn't to run takeoff
# but to run starter to test takeoff in CI
FROM ghcr.io/prefix-dev/pixi:0.66.0

RUN apt-get update \
  && apt-get install -y wait-for-it git \
  && rm -rf /var/lib/apt/lists/*

RUN useradd --system -m tangosys

COPY --chown=tangosys . /app
WORKDIR /app

USER tangosys

# Create the servers environment and install the dummy servers
# Other tasks need to be run when the container is running
# to get the hostname and have access to Tango database
RUN pixi run install-servers

CMD /usr/bin/wait-for-it $TANGO_HOST --timeout=120 --strict -- \
    pixi run starter
