feat: add Dockerfile + app service for production deploy

Adds a production Docker image (node:20-alpine) and an `app` service in
docker-compose.yml so the Next.js app can run as a long-lived container
instead of just build/test in ephemeral containers. Requires `apk add
openssl` before `npm ci`, otherwise Prisma silently picks the wrong query
engine binary on Alpine and only fails at runtime. Also wires
AUTH_TRUST_HOST=true, required by Auth.js when running behind the NPM
reverse proxy.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
toanhoang
2026-08-02 08:25:25 -04:00
co-authored by Claude Sonnet 5
parent 539e511022
commit 87e2cca019
5 changed files with 47 additions and 3 deletions
+13
View File
@@ -1,4 +1,17 @@
services:
app:
build: .
container_name: asset-license-mgmt-app
env_file:
- .env
ports:
- "3002:3000"
depends_on:
- db
restart: unless-stopped
networks:
- asset-license-mgmt
db:
image: postgres:16-alpine
container_name: asset-license-mgmt-db