Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
services:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Currently this file only starts the different database services, not the individual frontends and backend microservices. While that's fine and can certainly be helpful for local development, should we add citycatalyst, hiap, global-api etc. here for a full local deployment?

Previously we did this with e.g. minikube and our k8s config files (the idea was to not have separate configs for deployment and local development), but I think a docker-compose setup is certainly easier to get going with...

db:
image: postgres:16-alpine
environment:
POSTGRES_USER: citycatalyst
POSTGRES_PASSWORD: development
POSTGRES_DB: citycatalyst
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./scripts/init-databases.sql:/docker-entrypoint-initdb.d/init-databases.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U citycatalyst"]
interval: 5s
timeout: 5s
retries: 5

global-api:
build: ./global-api
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
environment:
DB_HOST: db
DB_PORT: "5432"
DB_NAME: ccglobal
DB_USER: ccglobal
DB_PASSWORD: development
profiles:
- full

volumes:
pgdata:
6 changes: 6 additions & 0 deletions scripts/init-databases.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- Creates the additional databases needed by other services.
-- The primary database (citycatalyst) is created automatically via
-- POSTGRES_DB in docker-compose.yml.

CREATE USER ccglobal WITH PASSWORD 'development';
CREATE DATABASE ccglobal OWNER ccglobal;
Loading