first commit

This commit is contained in:
William Valentin
2025-08-15 23:45:13 -07:00
commit c167c8623c
29 changed files with 1971 additions and 0 deletions

30
s3-nodejs-api/Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
# syntax=docker/dockerfile:1
# ARG NODE_VERSION=20-alpine
# FROM node:${NODE_VERSION} AS base
FROM oven/bun:latest AS base
WORKDIR /app
FROM base AS deps
COPY package.json ./
# Install only production dependencies for the runtime image
RUN bun install --omit=dev
FROM base AS build
COPY package.json ./
# Install all dependencies for building (includes devDeps like typescript)
RUN bun install
COPY tsconfig.json ./
COPY src ./src
RUN bun run build
FROM base AS runner
ENV NODE_ENV=production
USER bun
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY package.json ./
COPY --from=build /app/dist ./dist
EXPOSE 3000
CMD ["bun", "dist/app.js"]