From 5aa5fef9af12bf196a188855d48cd9eef8267cb5 Mon Sep 17 00:00:00 2001 From: Nick Trochalakis Date: Sun, 23 Aug 2026 16:32:54 -0700 Subject: [PATCH] Fix Dockerfile conflict markers broken on main (#3) * Fix conflict markers on main and guard CI against them PR #2 merged before the Dockerfile cleanup landed, leaving <<<<<<< markers that break docker compose build. Restore clean Docker files and fail CI if conflict markers appear in the tree. * Add CI check that fails on merge conflict markers * Narrow conflict-marker CI check to <<<<<<< and >>>>>>> --------- Co-authored-by: Cursor Agent --- .env.example | 3 --- .github/workflows/ci.yml | 10 ++++++++++ Dockerfile | 27 --------------------------- README.md | 11 ----------- 4 files changed, 10 insertions(+), 41 deletions(-) diff --git a/.env.example b/.env.example index c7563cb..8f6149a 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,6 @@ AUTH_SECRET=change-me-to-a-long-random-string # Optional: path to SQLite file (default ./data/rfid.db) # RFID_DB_PATH=./data/rfid.db -<<<<<<< HEAD # Docker Compose published port (default 3000) # RFID_PORT=3000 @@ -11,8 +10,6 @@ AUTH_SECRET=change-me-to-a-long-random-string # CREATE_USER_PASSWORD=changeme # CREATE_USER_NAME=Admin -======= ->>>>>>> origin/main # Optional OIDC (Authentik, Keycloak, Authelia, etc.) # AUTH_OIDC_ISSUER=https://sso.example.com/application/o/rfid/ # AUTH_OIDC_CLIENT_ID= diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95b91b4..152edf3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + + - name: Reject merge conflict markers + run: | + if git grep -nE '^(<<<<<<<|>>>>>>>)' -- . \ + ':(exclude)package-lock.json'; then + echo "::error::Merge conflict markers found in tracked files" + exit 1 + fi + echo "No conflict markers found" + - uses: actions/setup-node@v4 with: node-version: "22" diff --git a/Dockerfile b/Dockerfile index f134ce6..b10b00c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,33 +2,21 @@ FROM node:22-bookworm-slim AS deps WORKDIR /app -<<<<<<< HEAD RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ \ && rm -rf /var/lib/apt/lists/* -======= -RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/* ->>>>>>> origin/main COPY package.json package-lock.json ./ RUN npm ci FROM node:22-bookworm-slim AS builder WORKDIR /app -<<<<<<< HEAD RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ \ && rm -rf /var/lib/apt/lists/* -======= -RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/* ->>>>>>> origin/main COPY --from=deps /app/node_modules ./node_modules COPY . . ENV NEXT_TELEMETRY_DISABLED=1 ENV AUTH_SECRET=build-time-placeholder-secret-32chars -<<<<<<< HEAD RUN npm run build \ && npm prune --omit=dev -======= -RUN npm run build ->>>>>>> origin/main FROM node:22-bookworm-slim AS runner WORKDIR /app @@ -36,7 +24,6 @@ ENV NODE_ENV=production ENV NEXT_TELEMETRY_DISABLED=1 ENV RFID_DB_PATH=/data/rfid.db ENV PORT=3000 -<<<<<<< HEAD ENV HOSTNAME=0.0.0.0 ENV AUTH_TRUST_HOST=true @@ -65,18 +52,4 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ CMD curl -fsS http://127.0.0.1:3000/login >/dev/null || exit 1 ENTRYPOINT ["/entrypoint.sh"] -======= -RUN apt-get update && apt-get install -y libstdc++6 && rm -rf /var/lib/apt/lists/* -RUN mkdir -p /data && chown node:node /data -COPY --from=builder /app/package.json /app/package-lock.json ./ -COPY --from=builder /app/node_modules ./node_modules -COPY --from=builder /app/.next ./.next -COPY --from=builder /app/public ./public -COPY --from=builder /app/scripts ./scripts -COPY --from=builder /app/src ./src -COPY --from=builder /app/tsconfig.json ./tsconfig.json -USER node -EXPOSE 3000 -VOLUME ["/data"] ->>>>>>> origin/main CMD ["npm", "run", "start"] diff --git a/README.md b/README.md index 5cb4656..8f7b55c 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,6 @@ GitHub Actions runs lint, typecheck, and tests on every pull request and push to ## Docker -<<<<<<< HEAD ### docker compose (recommended) ```bash @@ -117,26 +116,16 @@ docker compose down ### Plain docker -======= ->>>>>>> origin/main ```bash docker build -t rfid-database . docker run --rm -p 3000:3000 \ -e AUTH_SECRET=your-long-secret \ -<<<<<<< HEAD -e CREATE_USER_EMAIL=admin@lab.local \ -e CREATE_USER_PASSWORD=changeme \ -======= ->>>>>>> origin/main -v rfid-data:/data \ rfid-database ``` -<<<<<<< HEAD -======= -Create the first user against the mounted DB (exec into the container or run `create-user` with `RFID_DB_PATH` pointed at the volume). - ->>>>>>> origin/main ## Security Tag dumps often include sector keys. Keep the app behind HTTPS, do not expose it publicly without auth, and treat `data/rfid.db` as sensitive.