- Multi-stage Dockerfile: builder compiles native modules (better-sqlite3, tiny-secp256k1) under target architecture, runtime is minimal Alpine - install.sh: POSIX sh installer (Alpine ash compatible) with architecture detection, Docker install, .env validation, health-check retry loop - docker-compose.yml: removed platform locks, .env read-only mount, 127.0.0.1 port binding, 384m mem limit (Orange Pi Zero 2 safe) - .dockerignore: excludes node_modules, secrets, tests, .kilo - README.md: complete rewrite with deployment docs for any device - Verified: POSIX sh syntax (dash), Dockerfile (docker build --check), docker-compose (docker compose config)
30 lines
655 B
YAML
30 lines
655 B
YAML
services:
|
|
telegram_shop_prod:
|
|
build:
|
|
context: .
|
|
dockerfile: ./Dockerfile
|
|
hostname: telegram_shop_prod
|
|
container_name: telegram_shop_prod
|
|
ports:
|
|
- "127.0.0.1:3001:3001"
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./db:/app/db/
|
|
- ./uploads:/app/uploads/
|
|
- ./.env:/app/.env:ro
|
|
cap_add:
|
|
- NET_ADMIN
|
|
sysctls:
|
|
- net.ipv4.conf.all.src_valid_mark=1
|
|
dns:
|
|
- 8.8.8.8
|
|
- 1.1.1.1
|
|
mem_limit: 384m
|
|
cpus: "1.0"
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-sf", "http://localhost:3001/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|