added docker config

This commit is contained in:
hello 2025-02-28 02:53:28 +05:30
parent 96ccd7faa0
commit ad57e0685e
3 changed files with 45 additions and 0 deletions

31
Dockerfile Normal file
View file

@ -0,0 +1,31 @@
# Build stage
FROM oven/bun:latest as build
WORKDIR /app
# Copy package files and install dependencies
COPY package.json bun.lockb* ./
RUN bun install --frozen-lockfile
# Copy all files
COPY . .
# Build the app
RUN bun run build
# Serve stage with Bun
FROM oven/bun:latest
WORKDIR /app
# Install a simple HTTP server
RUN bun add serve
# Copy built assets from build stage
COPY --from=build /app/dist /app/dist
# Expose port
EXPOSE 3000
# Start the static file server
CMD ["bunx", "serve", "dist", "-s", "-p", "3000"]