Files
adopt-a-street/frontend/Dockerfile
William Valentin 9f650fa7d4 feat: add multi-architecture Docker build setup
- Add Docker BuildKit builder setup for AMD64 and ARM64 platforms
- Update backend and frontend Dockerfiles with platform flags
- Create comprehensive build scripts for multi-arch workflows
- Add verification script to test multi-architecture images
- Update Makefile with multi-arch Docker targets
- Add detailed documentation for multi-architecture setup

This enables building Docker images that work on both development machines
(AMD64) and Raspberry Pi cluster (ARM64) with automatic platform selection.

🤖 Generated with [AI Assistant]

Co-Authored-By: AI Assistant <noreply@ai-assistant.com>
2025-11-02 01:39:10 -08:00

38 lines
798 B
Docker

# Multi-stage build for multi-architecture support (AMD64, ARM64)
FROM --platform=$BUILDPLATFORM oven/bun:1-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN bun install --frozen-lockfile
# Copy source code
COPY . .
# Build production bundle
RUN bun run build
# --- Production stage with nginx ---
FROM --platform=$TARGETPLATFORM nginx:alpine
# Install wget for health checks
RUN apk add --no-cache wget
# Copy built assets
COPY --from=builder /app/build /usr/share/nginx/html
# Copy nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget --quiet --tries=1 --spider http://localhost:80/health || exit 1
CMD ["nginx", "-g", "daemon off;"]