# This image is used for E2E tests in pictory

ARG ARCH=arm64
ARG DEBIAN_RELEASE=bullseye
ARG SOURCE_IMAGE=registry.gitlab.com/revolutionpi/webstatus/webstatus-testcafe-${DEBIAN_RELEASE}:${ARCH}-latest

FROM ${SOURCE_IMAGE} as builder

ARG COMMIT_SHA

LABEL org.opencontainers.image.title="revolutionpi/pictory/pictory-testcafe-${DEBIAN_RELEASE}"
LABEL org.opencontainers.image.version="${ARCH}-latest"
LABEL org.opencontainers.image.description="Docker image for running Testcafe E2E tests against pictory"
LABEL org.opencontainers.image.source="https://gitlab.com/revolutionpi/pictory"
LABEL org.opencontainers.image.revision=$COMMIT_SHA
LABEL org.opencontainers.image.arch=$ARCH
LABEL org.opencontainers.image.os=$DEBIAN_RELEASE
LABEL org.opencontainers.image.base.name=${SOURCE_IMAGE}

WORKDIR /opt/testcafe

COPY . .
RUN npm ci --omit dev

EXPOSE 80
EXPOSE 41080

EXPOSE 443
EXPOSE 41443

# Overwrite apache2 entrypoint from base image
ENTRYPOINT [""]

