docker-compose.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. services:
  2. db:
  3. image: mongo:7
  4. container_name: rhl-lieferscheine-db
  5. restart: unless-stopped
  6. environment:
  7. MONGO_INITDB_ROOT_USERNAME: root
  8. MONGO_INITDB_ROOT_PASSWORD: supersecret
  9. volumes:
  10. - db_data:/data/db
  11. # Do not publish MongoDB to the host in the base/server compose.
  12. # Containers can still reach it via the Compose network (service name: "db").
  13. expose:
  14. - "27017"
  15. healthcheck:
  16. test:
  17. [
  18. "CMD",
  19. "mongosh",
  20. "--quiet",
  21. "mongodb://root:supersecret@localhost:27017/admin?authSource=admin",
  22. "--eval",
  23. "db.adminCommand('ping').ok",
  24. ]
  25. interval: 10s
  26. timeout: 5s
  27. retries: 10
  28. start_period: 20s
  29. app:
  30. build: .
  31. container_name: rhl-lieferscheine-app
  32. restart: unless-stopped
  33. env_file:
  34. - ${ENV_FILE:-.env.docker}
  35. depends_on:
  36. db:
  37. condition: service_healthy
  38. ports:
  39. - "3000:3000"
  40. volumes:
  41. # Server mount: real NAS
  42. - /mnt/niederlassungen:/mnt/niederlassungen:ro
  43. command: sh -c "node scripts/validate-env.mjs && npm run start"
  44. volumes:
  45. db_data: