beeta/frontend/Dockerfile

43 lines
810 B
Text
Raw Normal View History

2025-08-13 12:34:47 -04:00
# Use Bun base image for builder
FROM oven/bun:1-alpine AS builder
2025-08-03 21:53:15 -04:00
WORKDIR /app
# Copy package files
COPY package*.json ./
2025-08-13 12:34:47 -04:00
COPY bun.lockb* ./
# Install dependencies with Bun
RUN bun install --frozen-lockfile
2025-08-03 21:53:15 -04:00
# Copy source files
COPY . .
# Set environment variables for build
ENV VITE_API_URL=http://localhost/api
ENV VITE_WS_URL=ws://localhost/ws
ENV VITE_STREAM_PORT=8088
# Build the application
2025-08-13 12:34:47 -04:00
RUN bun run build
2025-08-03 21:53:15 -04:00
2025-08-13 12:34:47 -04:00
# Production stage - can still use Bun
FROM oven/bun:1-alpine
2025-08-03 21:53:15 -04:00
WORKDIR /app
# Copy built application
COPY --from=builder /app/build ./build
COPY --from=builder /app/package*.json ./
# Install production dependencies only
2025-08-13 12:34:47 -04:00
RUN bun install --production
2025-08-03 21:53:15 -04:00
# Expose port
EXPOSE 3000
# Set environment to production
ENV NODE_ENV=production
2025-08-13 12:34:47 -04:00
# Run with Bun
CMD ["bun", "run", "build/index.js"]