mirror of
https://github.com/System-End/campfire.git
synced 2026-04-19 20:55:10 +00:00
feat: dockerfiles
This commit is contained in:
parent
1fac2477f5
commit
0373e60a43
2 changed files with 44 additions and 0 deletions
27
astro/Dockerfile
Normal file
27
astro/Dockerfile
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
FROM node:20-alpine AS base
|
||||||
|
|
||||||
|
FROM base AS deps
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
COPY prisma ./prisma
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
FROM base AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
|
COPY . .
|
||||||
|
RUN npx prisma generate
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM base AS runner
|
||||||
|
WORKDIR /app
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
|
COPY --from=builder /app/dist ./dist
|
||||||
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
|
COPY --from=builder /app/package.json ./package.json
|
||||||
|
COPY --from=builder /app/prisma ./prisma
|
||||||
|
|
||||||
|
EXPOSE 4321
|
||||||
|
|
||||||
|
CMD ["node", "./dist/server/entry.mjs"]
|
||||||
17
background/Dockerfile
Normal file
17
background/Dockerfile
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
FROM oven/bun:1 AS base
|
||||||
|
|
||||||
|
FROM base AS deps
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json bun.lock ./
|
||||||
|
COPY prisma ./prisma
|
||||||
|
RUN bun install --frozen-lockfile
|
||||||
|
|
||||||
|
FROM base AS runner
|
||||||
|
WORKDIR /app
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
|
COPY . .
|
||||||
|
RUN bunx prisma generate
|
||||||
|
|
||||||
|
CMD ["bun", "run", "src/index.ts"]
|
||||||
Loading…
Add table
Reference in a new issue