chore: add Docker local development environment#16
Conversation
Add Docker Compose configuration for local development with PostgreSQL and Temporal.
## Changes
### Docker Services
- Add docker-compose.yml with two services:
* PostgreSQL 16-alpine: Database service
- Port: 5432
- Database: memu
- User/Password: postgres/postgres (for local dev only)
- Persistent volume: postgres_data
- Health check included
* Temporal Server: Workflow orchestration
- Port: 7233
- Web UI: 8088
- SQLite storage (local dev)
- Depends on PostgreSQL
### Benefits
- One-command local environment setup
- Consistent development environment across team
- No need to install PostgreSQL locally
- Temporal ready for workflow development
## Usage
```bash
docker-compose up -d # Start services
docker-compose down # Stop services
docker-compose logs -f # View logs
```
## Security Note
- Default credentials are for local development only
- Do not use these settings in production
## TODO
- Consider separating Temporal database from main PostgreSQL
## Files Changed (1 file)
- docker-compose.yml: PostgreSQL and Temporal service configuration
There was a problem hiding this comment.
Pull request overview
Adds a Docker Compose-based local development environment to run required infrastructure services (PostgreSQL + Temporal) via one command.
Changes:
- Introduces a
docker-compose.ymlwith a PostgreSQL service (pgvector-enabled) including volume + healthcheck. - Adds a Temporal auto-setup service wired to the database and exposed via host ports.
- Defines a dedicated Docker network and persistent volume for local dev.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Change PostgreSQL port from 54320 to 5432 - Update default credentials to postgres/postgres/memu - Pin Temporal image version to 1.25.1 (from latest) - Update Temporal ports to 7233 and 8088 - Remove container_name to support multiple instances
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add temporalio/ui:2.31.2 for Temporal Web UI - Separate Temporal database (temporal) from app database (memu) - Remove incorrect port mapping 8088:8233 from temporal service - Expose Web UI on port 8088
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Note: Temporal uses the same database as the main app. | ||
| # TODO: For production, use a separate Temporal database or at minimum use | ||
| # different schemas within the same PostgreSQL instance. Sharing the same | ||
| # database can cause schema conflicts and is not recommended even for development. |
There was a problem hiding this comment.
The inline comment says Temporal uses the same database as the main app and warns about schema conflicts, but POSTGRES_DB=${TEMPORAL_DB:-temporal} configures a separate database by default. Please update these comments/TODOs to reflect the actual configuration (separate DB in the same Postgres instance) so developers don’t get misled.
| # Note: Temporal uses the same database as the main app. | |
| # TODO: For production, use a separate Temporal database or at minimum use | |
| # different schemas within the same PostgreSQL instance. Sharing the same | |
| # database can cause schema conflicts and is not recommended even for development. | |
| # Note: Temporal shares the same PostgreSQL instance as the main app but uses | |
| # a separate database (`TEMPORAL_DB`, default: `temporal`) from the app's | |
| # database (`POSTGRES_DB`, default: `memu`). | |
| # TODO: For production, consider using a separate PostgreSQL instance for Temporal | |
| # or at minimum keep Temporal and the app in separate databases as configured here. | |
| # Pointing both services at the same database can cause schema conflicts and is | |
| # not recommended. |
- Update docker-compose.yml comments to reflect separate databases (memu for app, temporal for Temporal) - Add Docker Compose local development section to README - Document all services, ports and environment variables
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ### Run with Docker Compose (Local Development) | ||
| Start the full local development environment with PostgreSQL and Temporal: | ||
|
|
||
| ```bash | ||
| # Start all services (PostgreSQL, Temporal, Temporal UI) |
There was a problem hiding this comment.
The text says this starts the "full local development environment", but docker compose up here only starts infrastructure (PostgreSQL/Temporal), not the FastAPI server. Please clarify that the API still needs to be started separately (e.g., via uv run fastapi dev) or rename the section to indicate it starts local dependencies.
| ### Run with Docker Compose (Local Development) | |
| Start the full local development environment with PostgreSQL and Temporal: | |
| ```bash | |
| # Start all services (PostgreSQL, Temporal, Temporal UI) | |
| ### Run local infrastructure with Docker Compose | |
| Start local infrastructure dependencies (PostgreSQL and Temporal). Start the FastAPI API server separately (see "Run from source" above): | |
| ```bash | |
| # Start infrastructure services (PostgreSQL, Temporal, Temporal UI) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add Docker Compose configuration for local development with PostgreSQL and Temporal.
Changes
Docker Services
Add docker-compose.yml with three services:
PostgreSQL 16 with pgvector: Database service
Temporal Server: Workflow orchestration
Temporal UI: Web management interface
Benefits