fosrl.pangolin/Dockerfile.pg

42 lines
920 B
Text
Raw Permalink Normal View History

2024-10-06 09:55:45 -04:00
FROM node:20-alpine AS builder
2024-09-28 18:17:37 -04:00
WORKDIR /app
2025-04-29 22:59:38 -04:00
# COPY package.json package-lock.json ./
2025-06-10 08:47:25 +02:00
COPY package*.json ./
RUN npm ci
2024-09-28 18:17:37 -04:00
COPY . .
2025-06-04 12:02:07 -04:00
RUN echo 'export * from "./pg";' > server/db/index.ts
2024-10-26 23:37:25 -04:00
2025-06-04 12:02:07 -04:00
RUN npx drizzle-kit generate --dialect postgresql --schema ./server/db/pg/schema.ts --out init
RUN npm run build:pg
2025-06-15 13:19:07 -04:00
RUN npm run build:cli
2024-09-28 18:17:37 -04:00
2024-10-06 09:55:45 -04:00
FROM node:20-alpine AS runner
2024-09-28 18:17:37 -04:00
WORKDIR /app
2025-03-08 18:11:39 -05:00
# Curl used for the health checks
RUN apk add --no-cache curl
2024-09-28 18:17:37 -04:00
2025-04-29 22:59:38 -04:00
# COPY package.json package-lock.json ./
2025-06-10 08:47:25 +02:00
COPY package*.json ./
RUN npm ci --omit=dev && npm cache clean --force
2024-09-28 18:17:37 -04:00
2025-03-08 18:11:39 -05:00
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
2024-09-28 18:17:37 -04:00
COPY --from=builder /app/dist ./dist
2024-12-25 16:40:39 -05:00
COPY --from=builder /app/init ./dist/init
2025-06-15 13:19:07 -04:00
COPY ./cli/wrapper.sh /usr/local/bin/pangctl
RUN chmod +x /usr/local/bin/pangctl ./dist/cli.mjs
2024-10-26 17:01:34 -04:00
COPY server/db/names.json ./dist/names.json
2024-09-28 18:17:37 -04:00
2025-01-04 20:22:01 -05:00
COPY public ./public
2025-06-04 12:02:07 -04:00
CMD ["npm", "run", "start:pg"]