# syntax=docker/dockerfile:1
# Illustrative build. Supply a digest-pinned Linux image with user/group tools.
ARG OS_IMAGE
FROM ${OS_IMAGE}
RUN groupadd --system app && useradd --system -g app app
WORKDIR /app
# Keep the more stable WAR layer reusable when settings or scripts change.
COPY --chown=app:app service.war /app/service.war
COPY --chown=app:app settings/ /app/settings/
COPY --chown=app:app --chmod=0755 launch.sh /app/launch.sh
USER app
ENTRYPOINT ["/app/launch.sh"]
