Skip to content

chore: add Docker local development environment#16

Merged
ankaisen merged 7 commits into
mainfrom
feature/1203-docker-local-env
Jan 29, 2026
Merged

chore: add Docker local development environment#16
ankaisen merged 7 commits into
mainfrom
feature/1203-docker-local-env

Conversation

@SparkZou
Copy link
Copy Markdown
Contributor

@SparkZou SparkZou commented Jan 25, 2026

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

      • Port: 5432
      • App Database: memu
      • Temporal Database: temporal (separate)
      • User/Password: postgres/postgres (for local dev only)
      • Persistent volume: postgres-data
      • Health check included
    • Temporal Server: Workflow orchestration

      • Port: 7233
      • PostgreSQL storage (connected to postgres service)
      • Depends on PostgreSQL
    • Temporal UI: Web management interface

      • Port: 8088
      • Depends on Temporal

Benefits

  • One-command local environment setup
  • Consistent development environment across team
  • No need to install PostgreSQL locally
  • Temporal ready for workflow development
  • Separate databases for app and Temporal to avoid conflicts

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
Copilot AI review requested due to automatic review settings January 25, 2026 05:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml with 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.

Comment thread docker-compose.yml Outdated
Comment thread docker-compose.yml
Comment thread docker-compose.yml Outdated
Comment thread docker-compose.yml Outdated
- 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
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docker-compose.yml Outdated
Comment thread docker-compose.yml
- 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
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docker-compose.yml Outdated
Comment on lines +22 to +25
# 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.
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
# 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.

Copilot uses AI. Check for mistakes.
Comment thread docker-compose.yml
- 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
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docker-compose.yml
Comment thread README.md Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread README.md Outdated
Comment on lines +38 to +42
### Run with Docker Compose (Local Development)
Start the full local development environment with PostgreSQL and Temporal:

```bash
# Start all services (PostgreSQL, Temporal, Temporal UI)
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
### 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)

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@SparkZou SparkZou requested a review from ankaisen January 29, 2026 02:44
Copy link
Copy Markdown
Contributor

@ankaisen ankaisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SparkZou Thank you! LGTM 👍

@ankaisen ankaisen merged commit 2800dec into main Jan 29, 2026
7 checks passed
@ankaisen ankaisen deleted the feature/1203-docker-local-env branch January 29, 2026 05:39
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.

3 participants