Setup Podman and Podman Compose for local development

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
This commit is contained in:
Claude
2025-12-24 00:53:53 +00:00
parent 6e9029bbbb
commit 17492ae250
11 changed files with 563 additions and 18 deletions
+16
View File
@@ -0,0 +1,16 @@
-- LightSaver Database Initialization Script
-- This script runs automatically when the PostgreSQL container starts for the first time
-- Create extensions if needed
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- Add your table definitions here
-- Example:
-- CREATE TABLE IF NOT EXISTS users (
-- id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
-- email VARCHAR(255) UNIQUE NOT NULL,
-- created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-- updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
-- );
-- Add initial seed data here if needed
+21
View File
@@ -0,0 +1,21 @@
# Database Initialization Scripts
SQL scripts in this directory are automatically executed when the PostgreSQL container is first initialized.
## Usage
- Scripts are executed in alphabetical order
- Use numbered prefixes (01-, 02-, etc.) to control execution order
- Place schema definitions in early scripts
- Place seed data in later scripts
## Example
- `01-init.sql` - Create extensions and initial schema
- `02-seed.sql` - Insert initial data
- `03-indexes.sql` - Create indexes
## Notes
- These scripts only run on first container creation
- To re-run, you must remove the postgres volume: `make clean` or `podman-compose down -v`