###
# This version of Torsearch can run the scheduler, downloader, and
# worker in one container. Each process is managerd by supervisord
# and can be configured via environment variables, and more than
# one of these containers can still be run.
###

# Default to latest, but should pass in a version
ARG APP_VERSION="latest"

# Set aside the actual app image so we can copy the app from there
FROM code.caldwell.digital/home/torsearch-app:${APP_VERSION} AS app_image

# Start with our base worker image
FROM code.caldwell.digital/home/torsearch-base-worker-supervisord:latest

# Set the APP_VERSION in the image
ENV APP_VERSION=${APP_VERSION}

ARG TMDB_API=""
ENV TMDB_API="${TMDB_API}"

# Copy the actual application code from the previously built app
COPY --chown=1000:1000 --from=app_image /app /app

# To retain backwards compatibility, default to async & download transports
CMD [ "--monitor" ]
