You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(docs): update deployment instructions for Docker Compose with host DB/Redis
- Revised `Deployment_Production.md` to clarify usage of `docker-compose.host-db.yml` for running the API with PostgreSQL and Redis on the host.
- Added details on environment variable requirements and updated health check instructions to reflect port changes.
- Improved clarity on deployment methods and removed outdated sections regarding full-stack deployments.
**Note**: The server uses Docker Compose v2 (plugin), use `docker compose` (not `docker-compose`). On this server, **PostgreSQL (Analytics/Ingestion) and Redis run on the host**, not in containers—so the recommended Docker option is **API only** with `docker-compose.host-db.yml`.
232
232
233
-
**Note**: The server uses Docker Compose v2 (plugin), use `docker compose` (not `docker-compose`).
233
+
### Method 1: Docker Compose – API only, host DB/Redis (Recommended for this server)
234
+
235
+
Use when PostgreSQL and Redis already run on the host (e.g. `notes_dwh`, system Redis). Only the API runs in a container; it connects to the host via `host.docker.internal`.
234
236
235
237
#### Initial Deployment
236
238
237
239
```bash
238
-
# Navigate to application directory
239
240
cd /opt/osm-notes-api
240
241
241
-
# Build and start services
242
-
docker compose -f docker/docker-compose.yml up -d
242
+
# Ensure .env has DB_PASSWORD (use double quotes if password contains #)
243
+
# --env-file .env loads variables from project root (Compose otherwise looks in docker/)
244
+
docker compose -f docker/docker-compose.host-db.yml --env-file .env up -d --build
To remove leftover postgres/redis containers from a previous full-stack run:
276
+
`docker compose -f docker/docker-compose.host-db.yml down --remove-orphans`
287
277
288
-
When PostgreSQL and Redis already run on the host (e.g. `notes_dwh`, system Redis), run only the API container and point it at the host:
278
+
Requires Docker 20.10+ (for `host-gateway`). Port mapping: `${PORT:-3010}:3000`.
289
279
290
-
```bash
291
-
cd /opt/osm-notes-api
280
+
### Alternative: Docker Compose full stack (API + Postgres + Redis in containers)
292
281
293
-
# Ensure .env has DB_PASSWORD (use double quotes if password contains #)
294
-
# DB_HOST/REDIS_HOST are overridden to host.docker.internal by this compose
282
+
Use only if you want the API, PostgreSQL, and Redis **all in containers** (e.g. testing or a environment without a host DB). Not for this server when Analytics/Ingestion DB and Redis are on the host.
295
283
296
-
docker compose -f docker/docker-compose.host-db.yml up -d --build
284
+
```bash
285
+
cd /opt/osm-notes-api
286
+
# Requires .env with DB_PASSWORD set (used by the postgres container)
287
+
docker compose -f docker/docker-compose.yml up -d --build
288
+
docker compose -f docker/docker-compose.yml ps
297
289
```
298
290
299
-
The API will connect to the host via `host.docker.internal` (requires Docker 20.10+ with `host-gateway`). Port defaults to `${PORT:-3010}:3000`.
0 commit comments