Skip to content

Instantly share code, notes, and snippets.

@sp90
Created September 18, 2023 11:24
Show Gist options
  • Save sp90/9eed6ea37d8f0901064f394af85304ea to your computer and use it in GitHub Desktop.
Save sp90/9eed6ea37d8f0901064f394af85304ea to your computer and use it in GitHub Desktop.
Temp solution for sharp bun docker
# 2 Stage build install sharp using npm
FROM node:20-bullseye-slim as installSharp
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm i sharp
# Install all deps using bun and copy the
# sharp install from first stage
FROM oven/bun as base
WORKDIR /app
COPY package.json bun.lockb ./
RUN bun i
COPY --from=installSharp /app/node_modules/sharp /app/node_modules/sharp
COPY . /app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment