chore: expose docker services on host ports
This commit is contained in:
@@ -4,6 +4,7 @@ NODE_ENV="development"
|
|||||||
# Frontend env vars for the Vite app
|
# Frontend env vars for the Vite app
|
||||||
VITE_API_BASE_URL="http://localhost:4000/api"
|
VITE_API_BASE_URL="http://localhost:4000/api"
|
||||||
VITE_GOOGLE_MAPS_PLATFORM_KEY="YOUR_BROWSER_MAPS_KEY"
|
VITE_GOOGLE_MAPS_PLATFORM_KEY="YOUR_BROWSER_MAPS_KEY"
|
||||||
|
WEB_PORT="3000"
|
||||||
|
|
||||||
# Backend env vars
|
# Backend env vars
|
||||||
# For Docker Compose deployments, point DATABASE_URL at the internal "db" host.
|
# For Docker Compose deployments, point DATABASE_URL at the internal "db" host.
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|||||||
- Updated the Docker Compose deployment config to read app secrets and Vite build settings from environment variables, and added a `.dockerignore` to keep container builds leaner.
|
- Updated the Docker Compose deployment config to read app secrets and Vite build settings from environment variables, and added a `.dockerignore` to keep container builds leaner.
|
||||||
- Aligned the Docker Compose and example environment settings so local and deployment configs use the same variable names and document URL-encoded database passwords when needed.
|
- Aligned the Docker Compose and example environment settings so local and deployment configs use the same variable names and document URL-encoded database passwords when needed.
|
||||||
- Simplified container deployment by adding a dedicated migration image and Compose startup ordering so the database becomes healthy, migrations run automatically, and the API, worker, and web services start afterward.
|
- Simplified container deployment by adding a dedicated migration image and Compose startup ordering so the database becomes healthy, migrations run automatically, and the API, worker, and web services start afterward.
|
||||||
|
- Published the Docker web and API services to host ports so local Compose runs are reachable directly from the browser with configurable `WEB_PORT` and `APP_PORT` values.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fixed the Docker startup flow by passing required env validation into the migration container, bundling SQL migrations into the runtime image, and creating pg-boss queues before the worker starts consuming them.
|
- Fixed the Docker startup flow by passing required env validation into the migration container, bundling SQL migrations into the runtime image, and creating pg-boss queues before the worker starts consuming them.
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ If you open the app from another machine on your LAN, set `VITE_API_BASE_URL` an
|
|||||||
- `POSTGRES_DB`
|
- `POSTGRES_DB`
|
||||||
- `POSTGRES_USER`
|
- `POSTGRES_USER`
|
||||||
- `POSTGRES_PASSWORD`
|
- `POSTGRES_PASSWORD`
|
||||||
|
- `WEB_PORT`
|
||||||
|
- `APP_PORT`
|
||||||
- `COOKIE_SECRET`
|
- `COOKIE_SECRET`
|
||||||
- `GOOGLE_MAPS_SERVER_KEY`
|
- `GOOGLE_MAPS_SERVER_KEY`
|
||||||
- `VITE_API_BASE_URL`
|
- `VITE_API_BASE_URL`
|
||||||
@@ -50,6 +52,7 @@ If you open the app from another machine on your LAN, set `VITE_API_BASE_URL` an
|
|||||||
`docker compose up --build`
|
`docker compose up --build`
|
||||||
|
|
||||||
The Compose stack starts PostGIS, waits for the database to become healthy, runs migrations automatically, and then starts the API, worker, and web containers.
|
The Compose stack starts PostGIS, waits for the database to become healthy, runs migrations automatically, and then starts the API, worker, and web containers.
|
||||||
|
With the default `.env.example` values, the app is exposed on `http://localhost:3000` and the API on `http://localhost:4000`.
|
||||||
|
|
||||||
## Database Layout
|
## Database Layout
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -49,8 +49,8 @@ services:
|
|||||||
PG_BOSS_SCHEMA: ${PG_BOSS_SCHEMA}
|
PG_BOSS_SCHEMA: ${PG_BOSS_SCHEMA}
|
||||||
SESSION_TTL_DAYS: ${SESSION_TTL_DAYS}
|
SESSION_TTL_DAYS: ${SESSION_TTL_DAYS}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
expose:
|
ports:
|
||||||
- ${APP_PORT}
|
- "${APP_PORT}:${APP_PORT}"
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
build:
|
build:
|
||||||
@@ -81,8 +81,8 @@ services:
|
|||||||
api:
|
api:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
expose:
|
ports:
|
||||||
- "80"
|
- "${WEB_PORT}:80"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
leads4less-db:
|
leads4less-db:
|
||||||
|
|||||||
Reference in New Issue
Block a user