-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Dockerfile to use Node.js base image and pnpm for package ma…
…nagement. Removed Bun references, updated installation commands, and ensured pnpm is available in the final image. This change streamlines the build process and aligns with the project's current dependency management strategy.
- Loading branch information
1 parent
54bfe0c
commit fa6e907
Showing
1 changed file
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,43 @@ | ||
# syntax = docker/dockerfile:1 | ||
|
||
# Adjust BUN_VERSION as desired | ||
ARG BUN_VERSION=1.1.18 | ||
FROM oven/bun:${BUN_VERSION}-slim as base | ||
# Use a Node.js base image | ||
FROM node:23-slim as base | ||
|
||
LABEL fly_launch_runtime="Bun" | ||
LABEL fly_launch_runtime="Node.js" | ||
|
||
# Bun app lives here | ||
# Node.js app lives here | ||
WORKDIR /app | ||
|
||
# Set production environment | ||
ENV NODE_ENV="production" | ||
|
||
|
||
# Throw-away build stage to reduce size of final image | ||
FROM base as build | ||
|
||
# Install packages needed to build node modules | ||
RUN apt-get update -qq && \ | ||
apt-get install --no-install-recommends -y build-essential pkg-config python-is-python3 | ||
|
||
# Install node modules | ||
COPY bun.lockb package.json ./ | ||
RUN bun install --ci | ||
# Install pnpm | ||
RUN npm install -g pnpm | ||
|
||
# Install node modules using pnpm | ||
COPY pnpm-lock.yaml ./ | ||
COPY package.json ./ | ||
RUN pnpm install --frozen-lockfile | ||
|
||
# Copy application code | ||
COPY . . | ||
|
||
|
||
# Final stage for app image | ||
FROM base | ||
|
||
# Ensure pnpm is available in the final image | ||
RUN npm install -g pnpm | ||
|
||
# Copy built application | ||
COPY --from=build /app /app | ||
|
||
# Start the server by default, this can be overwritten at runtime | ||
EXPOSE 3000 | ||
CMD [ "bun", "run", "start" ] | ||
CMD [ "pnpm", "start" ] |