app.dockerfile 992 B

1234567891011121314151617181920212223242526272829303132333435
  1. FROM node:20.18.0-slim AS builder
  2. WORKDIR /home/perplexica
  3. COPY package.json yarn.lock ./
  4. RUN yarn install --frozen-lockfile --network-timeout 600000
  5. COPY tsconfig.json next.config.mjs next-env.d.ts postcss.config.js drizzle.config.ts tailwind.config.ts ./
  6. COPY src ./src
  7. COPY public ./public
  8. RUN mkdir -p /home/perplexica/data
  9. RUN yarn build
  10. RUN yarn add --dev @vercel/ncc
  11. RUN yarn ncc build ./src/lib/db/migrate.ts -o migrator
  12. FROM node:20.18.0-slim
  13. WORKDIR /home/perplexica
  14. COPY --from=builder /home/perplexica/public ./public
  15. COPY --from=builder /home/perplexica/.next/static ./public/_next/static
  16. COPY --from=builder /home/perplexica/.next/standalone ./
  17. COPY --from=builder /home/perplexica/data ./data
  18. COPY drizzle ./drizzle
  19. COPY --from=builder /home/perplexica/migrator/build ./build
  20. COPY --from=builder /home/perplexica/migrator/index.js ./migrate.js
  21. RUN mkdir /home/perplexica/uploads
  22. COPY entrypoint.sh ./entrypoint.sh
  23. RUN chmod +x ./entrypoint.sh
  24. CMD ["./entrypoint.sh"]