Guide Docker Development - osama1998H/Moca GitHub Wiki
Docker Development Setup
Docker Compose for PostgreSQL, Redis, and Meilisearch, plus integration testing.
docker-compose.yml
Moca provides a Docker Compose file for local development:
services:
postgres:
image: postgres:16
ports:
- "5433:5432"
environment:
POSTGRES_USER: moca
POSTGRES_PASSWORD: moca_test
POSTGRES_DB: moca_test
tmpfs: /var/lib/postgresql/data
redis:
image: redis:7
ports:
- "6380:6379"
tmpfs: /data
meilisearch:
image: getmeili/meilisearch:v1.12
ports:
- "7700:7700"
tmpfs: /meili_data
All services use tmpfs for fast, ephemeral storage (data doesn't persist across restarts).
Starting Services
docker-compose up -d
Integration Testing
Integration tests use the integration build tag and expect Docker services:
make test-integration # Runs with -tags=integration
Default test connection settings:
- PostgreSQL:
localhost:5433, usermoca, passwordmoca_test, dbmoca_test - Redis:
localhost:6380 - Meilisearch:
localhost:7700