Skip to content

feat: implement local/self-host environments with docker#387

Open
sconetto wants to merge 9 commits into
sambecker:mainfrom
sconetto:feat-implement-local-compose-132
Open

feat: implement local/self-host environments with docker#387
sconetto wants to merge 9 commits into
sambecker:mainfrom
sconetto:feat-implement-local-compose-132

Conversation

@sconetto

@sconetto sconetto commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

PR Description: Docker Compose Support for Local Development & Self-Hosting

Closes #132 and #382

Summary

Adds complete Docker Compose infrastructure for running exif-photo-blog locally and self-hosting in production, eliminating dependency on Vercel-specific services.

What's New

Docker Services:

  • app - Next.js application with hot-reload for development
  • postgres - PostgreSQL database for metadata storage
  • minio - S3-compatible object storage for photos
  • imgproxy - Image optimization and processing
  • redis - Rate limiting (optional)

Key Features:

  • Multi-stage Dockerfile for production builds
  • Separate compose files for dev (dev-docker-compose.yml) and production (docker-compose.yml)
  • Custom image loader for imgproxy integration
  • Automatic MinIO bucket creation and policy configuration
  • Support for local URL resolution in containerized environments
  • Environment templates for both dev and production

Documentation:

  • Complete self-hosting guide (docs/SELF_HOSTING.md)
  • Updated README with Docker development instructions
  • Added .agent.md for project context

Technical Changes

Configuration:

  • Added NEXT_PUBLIC_IMAGE_LOADER and NEXT_PUBLIC_IMGPROXY_URL env vars
  • Updated next.config.ts with custom loader support for self-hosting
  • Fixed MinIO client to use internal endpoints for server-side operations
  • Added CORS configuration for MinIO

Code Updates:

  • Enhanced URL resolution for Docker networking (localhost → container names)
  • Added fallback to S3 client for internal MinIO fetches
  • Updated image loader to work with imgproxy
  • Fixed presigned URL generation for browser uploads

Usage

# Development
cp .env.example.local .env.local
docker compose -f dev-docker-compose.yml up

# Production
cp .env.example.production .env.production
# Edit .env.production with your values
docker compose up -d

Services

Service Port Purpose
app 3000 Next.js application
postgres 5432 Database
minio 9000/9001 Object storage/API
imgproxy 8080 Image optimization
redis 6379 Rate limiting (optional)

Breaking Changes

None - all changes are additive and backward compatible with existing Vercel deployments.

Testing

  • Verified image upload via presigned URLs
  • Tested imgproxy image optimization
  • Confirmed EXIF data extraction
  • Validated MinIO bucket policies and CORS

sconetto added 9 commits March 8, 2026 16:06
- create Dockerfile to run service
- create compose for local development and production deployment
- create override example for custom production configuration
- create local and prod .env.example to speed up configuration
- create docker ignore
- create basic minio bucket policy
- update git ignore to remove local dev files from repository
- update vscode conf for single/double quotes


- update servers to update url usage when running locally/self-hosted
- update minio storage to differentiate between local deploy and vercel+minio
- update url manipulations on utility
- create image proxy loader to handle local/self-hosted image manipulation
…r#132

- add const to check if running local/self-hosted
- load custom image config when running local/self-hosted
- add self-hosting documentation
- create .agent.md to add context for agentic coding
- update readme including local development and docker features
@vercel

vercel Bot commented Mar 8, 2026

Copy link
Copy Markdown

@sconetto is attempting to deploy a commit to the Sam Becker Pro Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Self Hosting

1 participant