mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-13 15:35:00 +02:00
38 lines
828 B
Text
38 lines
828 B
Text
|
FROM node:20-alpine AS builder
|
||
|
|
||
|
WORKDIR /app
|
||
|
|
||
|
# COPY package.json package-lock.json ./
|
||
|
COPY package.json ./
|
||
|
RUN npm install
|
||
|
|
||
|
COPY . .
|
||
|
|
||
|
RUN echo 'export * from "./sqlite";' > server/db/index.ts
|
||
|
|
||
|
RUN npx drizzle-kit generate --dialect sqlite --schema ./server/db/sqlite/schema.ts --out init
|
||
|
|
||
|
RUN npm run build:sqlite
|
||
|
|
||
|
FROM node:20-alpine AS runner
|
||
|
|
||
|
WORKDIR /app
|
||
|
|
||
|
# Curl used for the health checks
|
||
|
RUN apk add --no-cache curl
|
||
|
|
||
|
# COPY package.json package-lock.json ./
|
||
|
COPY package.json ./
|
||
|
RUN npm install --only=production && npm cache clean --force
|
||
|
|
||
|
COPY --from=builder /app/.next/standalone ./
|
||
|
COPY --from=builder /app/.next/static ./.next/static
|
||
|
COPY --from=builder /app/dist ./dist
|
||
|
COPY --from=builder /app/init ./dist/init
|
||
|
|
||
|
COPY server/db/names.json ./dist/names.json
|
||
|
|
||
|
COPY public ./public
|
||
|
|
||
|
CMD ["npm", "run", "start:sqlite"]
|