Files
wms-app/docker-compose.yml
Thanakorn ae98dcdcdd Harden web root, secrets and realtime auth
- .htaccess: refuse .git, .env, docker, nodejs, sdlc*, scripts, archives and
  app internals; security headers, HSTS over TLS, optional HTTPS redirect
- uploads served through app/file.php to signed-in users only
- Apache/PHP hardening config for the container (ServerTokens, expose_php)
- least-privilege DB account and APP_SECRET_KEY via docker/php/provision.php;
  SMTP passwords re-encrypted with a random IV (secret_box.php)
- Socket.IO rooms from a PHP-signed token; /emit and cron refuse empty secrets
- escape notification text; CLI guards on build scripts; no fixed demo password
2026-09-24 14:53:40 +07:00

62 lines
1.5 KiB
YAML

services:
db:
image: mariadb:11
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_DATABASE: wms
volumes:
- db_data:/var/lib/mysql
- ./docker/mariadb/init-wms2.sql:/docker-entrypoint-initdb.d/init-wms2.sql:ro
networks: [wms]
php:
build:
context: .
dockerfile: docker/php/Dockerfile
restart: unless-stopped
depends_on: [db]
environment:
DB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
PUBLIC_HOST: ${PUBLIC_HOST}
EMIT_SECRET: ${EMIT_SECRET}
SMTP_USERNAME: ${SMTP_USERNAME}
SMTP_PASSWORD: ${SMTP_PASSWORD}
OTP_REQUIRED: ${OTP_REQUIRED:-false}
DB_APP_USER: ${DB_APP_USER:-wms_app}
DB_APP_PASSWORD: ${DB_APP_PASSWORD:-}
APP_SECRET_KEY: ${APP_SECRET_KEY:-}
# true once TLS is in place (directly or via a proxy): HTTP is redirected to HTTPS.
FORCE_HTTPS: ${FORCE_HTTPS:-false}
volumes:
- .:/var/www/html/wms-app
ports:
- "${HTTP_PORT:-80}:80"
networks: [wms]
node:
build:
context: .
dockerfile: docker/node/Dockerfile
restart: unless-stopped
depends_on: [php]
environment:
PORT: 3000
EMIT_SECRET: ${EMIT_SECRET}
PHP_BASE_URL: http://php
PHP_WEBROOT: /wms-app/app
ALLOWED_ORIGIN: http://${PUBLIC_HOST}
volumes:
- ./nodejs:/app
- node_modules:/app/node_modules
ports:
- "3000:3000"
networks: [wms]
volumes:
db_data:
node_modules:
networks:
wms: