mirror of https://github.com/TriliumNext/Notes
chore(docker): integrate debian-based container
parent
fada21027e
commit
dd99f6c918
@ -0,0 +1,25 @@
|
||||
FROM node:22.14.0-alpine AS builder
|
||||
RUN corepack enable
|
||||
|
||||
# Install native dependencies since we might be building cross-platform.
|
||||
WORKDIR /usr/src/app
|
||||
COPY ./dist/package.json ./dist/pnpm-lock.yaml /usr/src/app/
|
||||
RUN pnpm install --frozen-lockfile --prod && pnpm rebuild
|
||||
|
||||
FROM node:22.14.0-alpine
|
||||
# Install runtime dependencies
|
||||
RUN apk add --no-cache su-exec shadow
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY ./dist /usr/src/app
|
||||
RUN rm -rf /usr/src/app/node_modules/better-sqlite3
|
||||
COPY --from=builder /usr/src/app/node_modules/better-sqlite3 /usr/src/app/node_modules/better-sqlite3
|
||||
COPY ./start-docker.sh /usr/src/app
|
||||
|
||||
# Add application user
|
||||
RUN adduser -s /bin/false node; exit 0
|
||||
|
||||
# Configure container
|
||||
EXPOSE 8080
|
||||
CMD [ "sh", "./start-docker.sh" ]
|
||||
HEALTHCHECK --start-period=10s CMD exec su-exec node node docker_healthcheck.js
|
||||
Loading…
Reference in New Issue