Installation
Run both the application and its infrastructure in containers. This path keeps the local toolchain small and mounts the checkout for development.
The Compose stack includes PostgreSQL, Redis and Meilisearch. Hot reload reflects edits from the mounted checkout.
Info · When to use this
This setup works on any OS. On Windows, it is slower than the native monorepo flow because bind-mounted file watching crosses the Windows/WSL filesystem boundary. Prefer the native path for day-to-day Windows development.
xcode-select --install · Linux: sudo apt install gitstarters/docker/compose.infra.yml: databases + search, app on the host). Running the full containerized stack (starters/docker/compose.fullapp.dev.yml: app + MCP + OpenCode + Keycloak + infra) needs 12 GB machine RAM minimum, 16 GB recommended . On Windows, see the WSL2 memory settings.Info · Windows-specific
git config --global core.autocrlf input
git clone https://github.com/open-mercato/open-mercato.git
cd open-mercato
# Optional: customise environment before first run
cp apps/mercato/.env.example apps/mercato/.env
# Build and start the full dev stack
docker compose --project-directory . -f starters/docker/compose.fullapp.dev.yml up --build
The first run takes several minutes – Docker builds the image, installs dependencies, builds packages, applies migrations, and seeds demo data. Subsequent starts are much faster because initialisation is cached in a named volume.
Once the runtime is ready, open:
http://localhost:4000http://localhost:3000/backendSign in with the default credentials printed during initialisation (typically [email protected] / the password shown in the logs).
The starters/docker/compose.fullapp.dev.yml stack runs five services:
| Service | Image | Purpose |
|---|---|---|
| app | Built from Dockerfile (dev stage) | Next.js app with hot reload |
| postgres | pgvector/pgvector:pg17-trixie | PostgreSQL 17 with pgvector |
| redis | redis:7-alpine | Caching and event persistence |
| meilisearch | getmeili/meilisearch:v1.11 | Full-text search |
| opencode | Custom | Claude Code integration (optional) |
The app container:
/appnode_modules, .next, and package dist/ so the container manages its own buildsCHOKIDAR_USEPOLLING, WATCHPACK_POLLING) for reliable change detection on all platformsyarn mercato init; on subsequent runs applies pending migrations only# Start in detached mode (background)
docker compose --project-directory . -f starters/docker/compose.fullapp.dev.yml up -d
# View logs — all services
docker compose --project-directory . -f starters/docker/compose.fullapp.dev.yml logs -f
# View logs — app only
docker compose --project-directory . -f starters/docker/compose.fullapp.dev.yml logs -f app
# Rebuild after pulling new commits
docker compose --project-directory . -f starters/docker/compose.fullapp.dev.yml up --build
# Stop all services
docker compose --project-directory . -f starters/docker/compose.fullapp.dev.yml down
# Full reset — deletes all data and cached builds
docker compose --project-directory . -f starters/docker/compose.fullapp.dev.yml down -v
docker compose --project-directory . -f starters/docker/compose.fullapp.dev.yml up --build
The repository exposes yarn docker:* commands that run the equivalent workflow inside the running app container – so you don't need to type docker compose exec ... manually.
Start the dev stack first:
yarn docker:dev:up
Then run monorepo workflows from the host:
yarn docker:build:packages
yarn docker:generate
yarn docker:initialize
yarn docker:initialize -- --reinstall
yarn docker:db:migrate
yarn docker:lint
yarn docker:typecheck
yarn docker:test
yarn docker:install-skills # optional — only if you use an AI coding agent
yarn docker:install-skills is the container equivalent of yarn install-skills: nothing in the Docker setup installs agent skills for you, so run it once per clone if you plan to use Codex, Claude Code, Cursor, or another supported coding agent. It fetches the shared open-mercato/skills collection into the gitignored .agents/skills/ directory. Skip it otherwise; see Setup steps for the full explanation.
Restart the app service and tail logs:
yarn docker:dev
# Skip the install/build/generate phase (faster restart):
yarn docker:dev -- --skip-rebuilt
Most variables are pre-configured with sensible defaults in the compose file. Override them in the .env file next to the compose file (the repository root) before starting – that is the only file Compose interpolates ${...} values from. apps/mercato/.env is read by the app itself and cannot override a variable the compose file already sets in the container.
| Variable | Default | Description |
|---|---|---|
APP_PORT | 3000 | Host port for the app |
OM_DEV_SPLASH_PORT | 4000 | Host port for the startup splash page |
OM_DEV_AUTO_OPEN | 1 | Set to 0 to disable browser auto-open |
POSTGRES_PASSWORD | postgres | Database password |
JWT_SECRET | JWT in this dev stack; required in compose.fullapp.yml | Auth token secret. The dev stack (compose.fullapp.dev.yml) falls back to the insecure placeholder JWT so it starts out of the box; the production-style compose.fullapp.yml refuses to start without it. Generate one with openssl rand -hex 32. In production the app also rejects placeholder values and secrets shorter than 32 characters |
OPENAI_API_KEY | – | Enables OpenAI-backed AI features; combine it with OM_DISABLE_VECTOR_SEARCH_AUTOINDEXING=false to turn vector auto-indexing on |
OM_DISABLE_VECTOR_SEARCH_AUTOINDEXING | true in the shipped example env | Set to false or remove it to enable automatic vector indexing |
DEMO_MODE | true | Demo-deployment behaviour: shows the backend contact/feedback widget, locks attachment partition settings, and keeps the demo superadmin during mercato init. The demo notice bar is dropped only by the literal value false. To hide just the contact widget while leaving the rest on, use the ff_om_hide_contact browser flag |
Vector auto-indexing is disabled by default in apps/mercato/.env.example. To enable it, configure an embedding provider such as OPENAI_API_KEY and set OM_DISABLE_VECTOR_SEARCH_AUTOINDEXING=false before you start the stack. The legacy alias DISABLE_VECTOR_SEARCH_AUTOINDEXING=1 is still honored for older deployments.
Container fails to start on Windows:
core.autocrlf=input to avoid CRLF issues in shell scripts.File changes not detected: The compose file sets polling by default. If changes are still not picked up:
docker compose --project-directory . -f starters/docker/compose.fullapp.dev.yml restart app
Port conflicts:
# Change app port
APP_PORT=3001 docker compose --project-directory . -f starters/docker/compose.fullapp.dev.yml up
# Change splash port
OM_DEV_SPLASH_PORT=4100 docker compose --project-directory . -f starters/docker/compose.fullapp.dev.yml up
# Change Postgres port (when localhost:5432 is occupied)
POSTGRES_PORT=55432 docker compose --project-directory . -f starters/docker/compose.fullapp.dev.yml up
# And update DATABASE_URL in .env to match
Slow file watching on Windows/WSL 2:
Store the repository inside the WSL 2 filesystem (\\wsl$\Ubuntu\home\...) rather than on the Windows filesystem (/mnt/c/...) for significantly better I/O performance.