Fly.io setup with 1 machine

This commit is contained in:
Dominic Ferrando
2025-05-04 15:23:05 -04:00
parent d5da472661
commit 228b4a7b94
6 changed files with 90 additions and 1 deletions
+35
View File
@@ -0,0 +1,35 @@
# syntax = docker/dockerfile:1
FROM oven/bun:1.2.12-slim as base
LABEL fly_launch_runtime="Bun"
# NodeJS 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 -y python-is-python3 pkg-config build-essential
# Install node modules
COPY --link package.json .
RUN bun install --production
# Copy application code
COPY --link . .
# Final stage for app image
FROM base
# Copy built application
COPY --from=build /app /app
# Start the server by default, this can be overwritten at runtime
CMD [ "bun", "run", "start" ]