# Kodium = upstream Postiz with Kodium branding layered on top.
# Bump POSTIZ_VERSION to upgrade; branding/apply.sh fails the build if upstream
# changes something it relies on.
ARG POSTIZ_VERSION=v2.24.0
FROM ghcr.io/gitroomhq/postiz-app:${POSTIZ_VERSION}

LABEL org.opencontainers.image.description="Kodium social media scheduler (branded Postiz, AGPL-3.0)" \
      org.opencontainers.image.licenses="AGPL-3.0"

COPY branding /branding
RUN sh /branding/apply.sh

# AGPL source offer: the running app serves its own corresponding source (our changes;
# upstream is linked in SOURCE.md) at https://app.kodium.app/auth/kodium-source.tar.gz.
# /auth/ because the app redirects other top-level paths to the sign-in page.
# Deploy scripts, CI config and infra notes (README, CLAUDE.md) are deliberately left out.
COPY Dockerfile LICENSE SOURCE.md /kodium-source/
COPY tools /kodium-source/tools
RUN cp -r /branding /kodium-source/branding  && tar -czf /app/apps/frontend/public/auth/kodium-source.tar.gz -C /kodium-source .  && rm -rf /kodium-source
