Wire API services to PostGIS in docker-compose, broaden CORS handling for cross-origin clients, and align developer docs with the production momswap URL. Made-with: Cursor
This commit is contained in:
@@ -1,4 +1,23 @@
|
||||
services:
|
||||
db:
|
||||
image: postgis/postgis:17-3.5
|
||||
container_name: momswap-backend-db
|
||||
environment:
|
||||
POSTGRES_DB: "${POSTGRES_DB:-momswap}"
|
||||
POSTGRES_USER: "${POSTGRES_USER:-momswap}"
|
||||
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-momswap}"
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ./var/posrgres:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-momswap} -d ${POSTGRES_DB:-momswap}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
restart: unless-stopped
|
||||
|
||||
api:
|
||||
build:
|
||||
context: .
|
||||
@@ -13,6 +32,10 @@ services:
|
||||
environment:
|
||||
ADDR: ":8080"
|
||||
ADMIN_PUBLIC_KEY: "${ADMIN_PUBLIC_KEY:-}"
|
||||
DATABASE_URL: "postgres://${POSTGRES_USER:-momswap}:${POSTGRES_PASSWORD:-momswap}@db:5432/${POSTGRES_DB:-momswap}?sslmode=disable"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "8080:8080"
|
||||
restart: unless-stopped
|
||||
@@ -32,6 +55,10 @@ services:
|
||||
environment:
|
||||
ADDR: ":8080"
|
||||
ADMIN_PUBLIC_KEY: "${ADMIN_PUBLIC_KEY:-}"
|
||||
DATABASE_URL: "postgres://${POSTGRES_USER:-momswap}:${POSTGRES_PASSWORD:-momswap}@db:5432/${POSTGRES_DB:-momswap}?sslmode=disable"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "8080:8080"
|
||||
restart: unless-stopped
|
||||
@@ -50,3 +77,4 @@ services:
|
||||
path: ./go.mod
|
||||
- action: rebuild
|
||||
path: ./Dockerfile
|
||||
|
||||
|
||||
Reference in New Issue
Block a user