mirror of
https://github.com/Chewbaccalakis/rfid-database.git
synced 2026-09-10 00:11:56 -07:00
Add Docker Compose setup with persistent volume
Improve the production Dockerfile (healthcheck, entrypoint bootstrap user, pruned deps) and add docker-compose.yml plus .dockerignore for one-command deploy with a named SQLite volume.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
services:
|
||||
rfid-database:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: rfid-database:local
|
||||
container_name: rfid-database
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${RFID_PORT:-3000}:3000"
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
RFID_DB_PATH: /data/rfid.db
|
||||
PORT: "3000"
|
||||
HOSTNAME: 0.0.0.0
|
||||
AUTH_TRUST_HOST: "true"
|
||||
# Optional bootstrap (only creates if missing):
|
||||
# CREATE_USER_EMAIL: [email protected]
|
||||
# CREATE_USER_PASSWORD: change-me
|
||||
# CREATE_USER_NAME: Admin
|
||||
# Optional OIDC — also set NEXT_PUBLIC_* in .env if using SSO button
|
||||
# AUTH_OIDC_ISSUER: ${AUTH_OIDC_ISSUER:-}
|
||||
# AUTH_OIDC_CLIENT_ID: ${AUTH_OIDC_CLIENT_ID:-}
|
||||
# AUTH_OIDC_CLIENT_SECRET: ${AUTH_OIDC_CLIENT_SECRET:-}
|
||||
# AUTH_OIDC_NAME: ${AUTH_OIDC_NAME:-SSO}
|
||||
volumes:
|
||||
- rfid-data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:3000/login"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 25s
|
||||
|
||||
volumes:
|
||||
rfid-data:
|
||||
Reference in New Issue
Block a user