Configure Docker volume for persistent SQLite database
All checks were successful
Automated Container Build / build-and-push (push) Successful in 12s

This commit is contained in:
Elijah 2026-06-27 20:05:42 -07:00
parent fad28140fd
commit ce45c09b20

View file

@ -16,7 +16,11 @@ RUN npm run build
FROM node:22-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN useradd --system --create-home appuser
ENV PORT=3726
ENV DATABASE_URL="file:/app/data/study.db"
RUN useradd --system --create-home appuser && mkdir -p /app/data && chown -R appuser:appuser /app
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
@ -25,5 +29,6 @@ COPY --from=builder /app/prisma.config.ts ./
COPY docker-entrypoint.sh ./
RUN chmod +x docker-entrypoint.sh && chown -R appuser:appuser /app
USER appuser
EXPOSE 3000
EXPOSE 3726
VOLUME ["/app/data"]
ENTRYPOINT ["./docker-entrypoint.sh"]