Files
AdventureLog/frontend/Dockerfile
Sean Morley 42785f1925 v0.12.1 version update + itinerary validation fixes (#1158)
* fix(itinerary): suppress false-positive UniqueTogetherValidator in CollectionItineraryItemSerializer (#1157)

DRF 3.15 inspects `UniqueConstraint` entries from `Model._meta.constraints`
and auto-generates `UniqueTogetherValidator` objects for them, but strips
each constraint's `condition` argument in the process.

The `CollectionItineraryItem` model has two conditional constraints:
- `unique_order_per_collection_day`: unique `(collection, date, order)`
  only when `is_global=False AND date IS NOT NULL`
- `unique_order_per_collection_global`: unique `(collection, order)`
  only when `is_global=True`

Without their conditions, DRF turns the second constraint into a validator
that checks `(collection, order)` across *all* rows regardless of type.
This means adding any dated itinerary item (transportation, lodging, etc.)
with `order=0` is rejected with 400 whenever a trip-wide (global) item
already holds `order=0` for the same collection — which is almost always,
since global items start at order 0.

Fix: set `validators = []` on the serializer Meta to suppress the
incorrectly-stripped validators. The view already adjusts `order` to avoid
real conflicts within each group, and the DB-level constraints continue
to enforce conditional uniqueness correctly.

This actually fixes #1153 for me

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(release): update version to v0.12.1 in settings, documentation, Dockerfile, and config

* fix(config): update appVersion to remove suffix and align with release v0.12.1

* docs(changelog): update v0.12.1 release notes with new features and improvements

---------

Co-authored-by: Maxim Burgerhout <maxim@wzzrd.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 12:58:42 -04:00

48 lines
1.8 KiB
Docker

FROM cgr.dev/chainguard/node:latest-dev@sha256:6eec455f386d097fc57d8aa73bd06c27ab91faa4f02f9103f94b4c56e0f9a80b AS build
USER root
WORKDIR /app
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
# Use Corepack so pnpm is managed by Node, not a global npm install.
RUN corepack enable && corepack prepare pnpm@10.32.1 --activate
# Copy package manager files first for better Docker layer caching.
COPY package.json pnpm-lock.yaml* pnpm-workspace.yaml* .npmrc* ./
# Clean install all node modules using pnpm with frozen lockfile.
RUN pnpm install --frozen-lockfile
# Copy source, then build the frontend assets.
COPY . .
RUN rm -f .env && pnpm run build
FROM gcr.io/distroless/nodejs22-debian12:nonroot@sha256:13593b7570658e8477de39e2f4a1dd25db2f836d68a0ba771251572d23bb4f8e AS external-website
# Metadata labels for the AdventureLog image
LABEL maintainer="Sean Morley" \
version="v0.12.1" \
description="AdventureLog - the ultimate self-hosted travel companion." \
org.opencontainers.image.title="AdventureLog" \
org.opencontainers.image.description="AdventureLog is a self-hosted travel companion that helps you plan, track, and share your adventures." \
org.opencontainers.image.version="v0.12.1" \
org.opencontainers.image.authors="Sean Morley" \
org.opencontainers.image.url="https://raw.githubusercontent.com/seanmorley15/AdventureLog/refs/heads/main/brand/banner.png" \
org.opencontainers.image.source="https://github.com/seanmorley15/AdventureLog" \
org.opencontainers.image.vendor="Sean Morley" \
org.opencontainers.image.licenses="GPL-3.0"
WORKDIR /app
ENV NODE_ENV=production
COPY --from=build /app/build ./build
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/package.json ./package.json
EXPOSE 3000
# Distroless node image uses node as entrypoint.
CMD ["build/index.js"]