mirror of
https://github.com/Chewbaccalakis/rfid-database.git
synced 2026-09-09 16:01:56 -07:00
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 <[email protected]>
This commit is contained in:
co-authored by
Cursor Agent
parent
d3ed4566b7
commit
5aa5fef9af
@@ -2,7 +2,6 @@ AUTH_SECRET=change-me-to-a-long-random-string
|
|||||||
# Optional: path to SQLite file (default ./data/rfid.db)
|
# Optional: path to SQLite file (default ./data/rfid.db)
|
||||||
# RFID_DB_PATH=./data/rfid.db
|
# RFID_DB_PATH=./data/rfid.db
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
# Docker Compose published port (default 3000)
|
# Docker Compose published port (default 3000)
|
||||||
# RFID_PORT=3000
|
# RFID_PORT=3000
|
||||||
|
|
||||||
@@ -11,8 +10,6 @@ AUTH_SECRET=change-me-to-a-long-random-string
|
|||||||
# CREATE_USER_PASSWORD=changeme
|
# CREATE_USER_PASSWORD=changeme
|
||||||
# CREATE_USER_NAME=Admin
|
# CREATE_USER_NAME=Admin
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> origin/main
|
|
||||||
# Optional OIDC (Authentik, Keycloak, Authelia, etc.)
|
# Optional OIDC (Authentik, Keycloak, Authelia, etc.)
|
||||||
# AUTH_OIDC_ISSUER=https://sso.example.com/application/o/rfid/
|
# AUTH_OIDC_ISSUER=https://sso.example.com/application/o/rfid/
|
||||||
# AUTH_OIDC_CLIENT_ID=
|
# AUTH_OIDC_CLIENT_ID=
|
||||||
|
|||||||
@@ -10,6 +10,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- 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
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "22"
|
node-version: "22"
|
||||||
|
|||||||
-27
@@ -2,33 +2,21 @@
|
|||||||
|
|
||||||
FROM node:22-bookworm-slim AS deps
|
FROM node:22-bookworm-slim AS deps
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
<<<<<<< HEAD
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ \
|
RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& 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 ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
FROM node:22-bookworm-slim AS builder
|
FROM node:22-bookworm-slim AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
<<<<<<< HEAD
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ \
|
RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& 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 --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV AUTH_SECRET=build-time-placeholder-secret-32chars
|
ENV AUTH_SECRET=build-time-placeholder-secret-32chars
|
||||||
<<<<<<< HEAD
|
|
||||||
RUN npm run build \
|
RUN npm run build \
|
||||||
&& npm prune --omit=dev
|
&& npm prune --omit=dev
|
||||||
=======
|
|
||||||
RUN npm run build
|
|
||||||
>>>>>>> origin/main
|
|
||||||
|
|
||||||
FROM node:22-bookworm-slim AS runner
|
FROM node:22-bookworm-slim AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -36,7 +24,6 @@ ENV NODE_ENV=production
|
|||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV RFID_DB_PATH=/data/rfid.db
|
ENV RFID_DB_PATH=/data/rfid.db
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
<<<<<<< HEAD
|
|
||||||
ENV HOSTNAME=0.0.0.0
|
ENV HOSTNAME=0.0.0.0
|
||||||
ENV AUTH_TRUST_HOST=true
|
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
|
CMD curl -fsS http://127.0.0.1:3000/login >/dev/null || exit 1
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
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"]
|
CMD ["npm", "run", "start"]
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ GitHub Actions runs lint, typecheck, and tests on every pull request and push to
|
|||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
### docker compose (recommended)
|
### docker compose (recommended)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -117,26 +116,16 @@ docker compose down
|
|||||||
|
|
||||||
### Plain docker
|
### Plain docker
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> origin/main
|
|
||||||
```bash
|
```bash
|
||||||
docker build -t rfid-database .
|
docker build -t rfid-database .
|
||||||
docker run --rm -p 3000:3000 \
|
docker run --rm -p 3000:3000 \
|
||||||
-e AUTH_SECRET=your-long-secret \
|
-e AUTH_SECRET=your-long-secret \
|
||||||
<<<<<<< HEAD
|
|
||||||
-e CREATE_USER_EMAIL=[email protected] \
|
-e CREATE_USER_EMAIL=[email protected] \
|
||||||
-e CREATE_USER_PASSWORD=changeme \
|
-e CREATE_USER_PASSWORD=changeme \
|
||||||
=======
|
|
||||||
>>>>>>> origin/main
|
|
||||||
-v rfid-data:/data \
|
-v rfid-data:/data \
|
||||||
rfid-database
|
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
|
## 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.
|
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.
|
||||||
|
|||||||
Reference in New Issue
Block a user