Switch local API port to 8122 and keep DB internal.
CI / test (push) Successful in 5s

Update runtime defaults, compose mappings, frontend defaults, and developer docs to use port 8122 while keeping PostGIS reachable only via the internal compose network.

Made-with: Cursor
This commit is contained in:
2026-03-01 12:12:44 +00:00
parent a2aae391ad
commit c2aa716ed8
6 changed files with 15 additions and 17 deletions
+4 -4
View File
@@ -23,8 +23,8 @@ RUN --mount=type=cache,target=/go/pkg/mod \
go build -p "$(nproc)" -trimpath -ldflags="-s -w" -o /out/api ./cmd/api
FROM base AS dev
ENV ADDR=:8080
EXPOSE 8080
ENV ADDR=:8122
EXPOSE 8122
CMD ["go", "run", "./cmd/api"]
FROM gcr.io/distroless/static-debian12:nonroot AS runtime
@@ -32,7 +32,7 @@ FROM gcr.io/distroless/static-debian12:nonroot AS runtime
WORKDIR /app
COPY --from=builder /out/api /app/api
ENV ADDR=:8080
EXPOSE 8080
ENV ADDR=:8122
EXPOSE 8122
ENTRYPOINT ["/app/api"]
+4 -4
View File
@@ -22,11 +22,11 @@ go run ./cmd/api
Primary deployed base URL: `https://momswap.produktor.duckdns.org/`.
Local default (for development): `http://localhost:8080`.
Local default (for development): `http://localhost:8122`.
Optional environment variables:
- `ADDR` (default `:8080`)
- `ADDR` (default `:8122`)
- `ADMIN_PUBLIC_KEY` (bootstrap initial inviter/admin user)
## Docker Compose
@@ -40,7 +40,7 @@ COMPOSE_BAKE=true docker compose up --build -d
This starts:
- `db` (`postgis/postgis`) on `5432`
- `api` on `8080`, wired with `DATABASE_URL` to the `db` service
- `api` on `8122`, wired with `DATABASE_URL` to the `db` service
Stop the service:
@@ -74,7 +74,7 @@ go run ./cmd/api
Then visit:
- Production: `https://momswap.produktor.duckdns.org/web/`
- Local: `http://localhost:8080/web/`
- Local: `http://localhost:8122/web/`
## API client library
+1 -1
View File
@@ -12,7 +12,7 @@ import (
)
func main() {
addr := getEnv("ADDR", ":8080")
addr := getEnv("ADDR", ":8122")
adminPublicKey := os.Getenv("ADMIN_PUBLIC_KEY")
memory := store.NewMemoryStore()
+4 -6
View File
@@ -6,8 +6,6 @@ services:
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:
@@ -30,14 +28,14 @@ services:
image: momswap-backend:latest
container_name: momswap-backend-api
environment:
ADDR: ":8080"
ADDR: ":8122"
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"
- "8122:8122"
restart: unless-stopped
api-dev:
@@ -53,14 +51,14 @@ services:
image: momswap-backend:dev
container_name: momswap-backend-api-dev
environment:
ADDR: ":8080"
ADDR: ":8122"
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"
- "8122:8122"
restart: unless-stopped
develop:
watch:
+1 -1
View File
@@ -102,4 +102,4 @@ For no-bundler apps, import the built ESM file:
The backend itself serves static UI at `/web/`, but this library can be consumed by any frontend runtime that supports `fetch`, `TextEncoder`, and ES modules.
For local development you can switch the client base URL to `http://localhost:8080`.
For local development you can switch the client base URL to `http://localhost:8122`.
+1 -1
View File
@@ -4,7 +4,7 @@ const { createApp, ref, reactive, onMounted } = Vue;
createApp({
setup() {
const apiBase = ref(localStorage.getItem("geo_api_base") || "http://localhost:8080");
const apiBase = ref(localStorage.getItem("geo_api_base") || "http://localhost:8122");
const state = reactive({
publicKey: "",
privateKey: "",