FROM code.caldwell.digital/home/torsearch-base:php8.4

ARG APP_VERSION="0.0.0-dev"
ENV APP_VERSION="${APP_VERSION}"

COPY . /app
COPY --chmod=775 docker/app/entrypoint.sh /usr/local/bin/docker-entrypoint
COPY docker/app/Caddyfile /etc/frankenphp/Caddyfile

ENTRYPOINT [ "/usr/local/bin/docker-entrypoint" ]

CMD [ "frankenphp", "run", "--config", "/etc/frankenphp/Caddyfile" ]

HEALTHCHECK --interval=3s --timeout=3s --retries=10 CMD [ "php", "/app/bin/console", "startup:status" ]
