Add comprehensive Podman configuration for local development: - docker-compose.yml: Main compose file with all services (PostgreSQL, RabbitMQ, API, Frontend) - docker-compose.dev.yml: Development-specific overrides with hot-reload - Dockerfile.api: Backend API service Dockerfile - Dockerfile.frontend: Frontend Next.js service Dockerfile - Updated Dockerfile: Podman-compatible production build with better layer caching - .env.example: Environment variable template - .dockerignore: Exclude unnecessary files from builds - Makefile: Convenient commands for common Podman operations - scripts/db/: Database initialization scripts directory - Updated README.md: Comprehensive Podman setup and usage documentation Features: - Rootless Podman support with SELinux compatibility - Development mode with volume mounts for hot-reload - Health checks for service dependencies - Proper build stage optimization - All services networked together
50 lines
1.5 KiB
Docker
50 lines
1.5 KiB
Docker
# Production Build - Podman Compatible
|
|
# 1. Build stage
|
|
FROM docker.io/library/node:22-slim AS builder
|
|
|
|
ENV NVM_DIR=/root/.nvm
|
|
ENV NODE_VERSION=22
|
|
|
|
# Install dependencies for Node
|
|
RUN apt-get update && \
|
|
apt-get dist-upgrade -y && \
|
|
apt-get install -y ca-certificates build-essential && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Enable corepack and prepare pnpm
|
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files first for better layer caching
|
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml turbo.json ./
|
|
COPY apps/lightsaver_user_client/package.json ./apps/lightsaver_user_client/
|
|
COPY packages ./packages
|
|
|
|
# Install dependencies
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
# Copy source code
|
|
COPY apps/lightsaver_user_client ./apps/lightsaver_user_client
|
|
|
|
# Build the application
|
|
RUN pnpm turbo run build --filter=lightsaver_user_client...
|
|
|
|
# 2. Production stage
|
|
FROM docker.io/library/node:22-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy built application and dependencies
|
|
COPY --from=builder /app/apps/lightsaver_user_client/.next ./apps/lightsaver_user_client/.next
|
|
COPY --from=builder /app/apps/lightsaver_user_client/public ./apps/lightsaver_user_client/public
|
|
COPY --from=builder /app/apps/lightsaver_user_client/package.json ./apps/lightsaver_user_client/
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --from=builder /app/packages ./packages
|
|
COPY --from=builder /app/package.json ./
|
|
|
|
EXPOSE 3000
|
|
|
|
# Run the production server
|
|
CMD ["node_modules/.bin/next", "start", "apps/lightsaver_user_client"] |