Add Docker deploy and Gitea Actions CI, plus a local testing guide
All checks were successful
Docker / build-and-push (push) Successful in 1m51s
All checks were successful
Docker / build-and-push (push) Successful in 1m51s
Dockerfile/docker-compose.yml mirror keep's pattern — same better-sqlite3 native-addon build story, same pull_policy: always + named volume for the SQLite DB so redeploys don't lose captured articles. Gitea Actions workflow builds and pushes to the Gitea container registry on push to main (needs a TKNTKN repo secret, same as keep/wisp/npm-statuspage). TESTING.md is the step-by-step for running the server + loading the extension unpacked, written up from what was actually verified end-to-end in the previous session. Verified: image builds, server starts and responds inside the container, capture works, and data survives a container restart. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
25
Dockerfile
Normal file
25
Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
FROM node:22-alpine AS build
|
||||
WORKDIR /app
|
||||
# better-sqlite3 has a native addon with no prebuilt binary for this
|
||||
# platform/Node combo yet — build it from source.
|
||||
RUN apk add --no-cache python3 make g++
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-alpine
|
||||
WORKDIR /app
|
||||
# Same native-addon rebuild needed for the production-only install below;
|
||||
# the toolchain is purged again afterward to keep the runtime image lean.
|
||||
RUN apk add --no-cache python3 make g++
|
||||
COPY package*.json ./
|
||||
RUN npm install --omit=dev && apk del python3 make g++
|
||||
COPY --from=build /app/dist ./dist
|
||||
|
||||
# DATA_DIR (SQLite DB) is a mutable runtime volume — not baked into the
|
||||
# image, so redeploys don't clobber captured articles.
|
||||
ENV DATA_DIR=/app/data
|
||||
|
||||
EXPOSE 3070
|
||||
CMD ["node", "dist/server/index.js"]
|
||||
Reference in New Issue
Block a user