Open MercatoDocsSearch docsAPI reference

Installation

Docker Dev Setup

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.


Prerequisites

Info · Windows-specific


Quick start

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:

Sign in with the default credentials printed during initialisation (typically [email protected] / the password shown in the logs).


How it works

The starters/docker/compose.fullapp.dev.yml stack runs five services:

ServiceImagePurpose
appBuilt from Dockerfile (dev stage)Next.js app with hot reload
postgrespgvector/pgvector:pg17-trixiePostgreSQL 17 with pgvector
redisredis:7-alpineCaching and event persistence
meilisearchgetmeili/meilisearch:v1.11Full-text search
opencodeCustomClaude Code integration (optional)

The app container:


Common operations

# 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

Docker wrapper commands

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

Environment variables

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.

VariableDefaultDescription
APP_PORT3000Host port for the app
OM_DEV_SPLASH_PORT4000Host port for the startup splash page
OM_DEV_AUTO_OPEN1Set to 0 to disable browser auto-open
POSTGRES_PASSWORDpostgresDatabase password
JWT_SECRETJWT in this dev stack; required in compose.fullapp.ymlAuth 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_AUTOINDEXINGtrue in the shipped example envSet to false or remove it to enable automatic vector indexing
DEMO_MODEtrueDemo-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.


Troubleshooting

Container fails to start on Windows:

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.

Previous: Dev Container · Next: Choose an installation path