Skip to content

Commit

Permalink
add buildkit examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegalbraith committed Jan 30, 2024
1 parent 04e275f commit 0c6a171
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
19 changes: 19 additions & 0 deletions buildkit/Dockerfile.buildkit-optimized
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:20 AS build

RUN corepack enable
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build

FROM node:20-slim

RUN apt-get update && apt-get install -y ca-certificates openssl && rm -rf /var/lib/apt/lists/*
RUN corepack enable
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --prod
COPY --from=build /app/build /app/build
ENV NODE_ENV production
CMD ["node", "./build/server.js"]
12 changes: 12 additions & 0 deletions buildkit/Dockerfile.not-optimized
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:20

RUN apt-get update && apt-get install -y ca-certificates openssl && rm -rf /var/lib/apt/lists/*
RUN corepack enable
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
RUN rm -rf node_modules && pnpm install --frozen-lockfile --prod
ENV NODE_ENV production
CMD ["node", "./build/server.js"]
3 changes: 3 additions & 0 deletions buildkit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# BuildKit

This folder contains various examples that are used to walk through BuildKit concepts in blog posts on [Depot](https://depot.dev).
11 changes: 11 additions & 0 deletions node/pnpm-fastify/Dockerfile.basic
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:20

RUN corepack enable

COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build

ENV NODE_ENV production
CMD ["node", "./dist/index.js"]

0 comments on commit 0c6a171

Please sign in to comment.