# ============================================================================= # feature-container-runtime-contract — dev environment override # # Merge with base: # docker compose -f docker-compose.yml -f docker-compose.dev.yml up # # Dev intent: # - Relaxes read-only filesystem (writable, no tmpfs constraint) so developers # can hot-swap files without image rebuilds. # - Increases memory allowance for dev/debugging workloads. # - Disables restart-unless-stopped so crash loops don't mask startup errors. # - Enables JMX remote port (local only, never in prod). # - Mounts a local source volume for fast iteration (optional; mount when IDE # attaches to the running container). # ============================================================================= services: app: # Relax read-only constraint for local development. read_only: false tmpfs: [] # no tmpfs in dev; rely on normal writable rootfs # More memory for dev profiling / heap dumps. mem_limit: 1g memswap_limit: 1g environment: TZ: "UTC" LANG: "C.UTF-8" LC_ALL: "C.UTF-8" # Use a shorter drain timeout in dev so restarts are faster. APP_SERVER_SHUTDOWN_TIMEOUT: "5s" APP_SERVER_SHUTDOWN: "graceful" # Remote JMX — bind to localhost only; NEVER expose in production. JAVA_TOOL_OPTIONS: >- -XX:MaxRAMPercentage=75 -XX:+UseContainerSupport -XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/tmp/heap -Dserver.tomcat.basedir=/tmp -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.rmi.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=127.0.0.1 ports: - "8080:8080" - "9001:9001" - "127.0.0.1:9999:9999" # JMX — localhost only # No health check constraint in dev; let the app start at its own pace. healthcheck: disable: true # Do not restart automatically so crash loops stay visible. restart: "no" # Optional: mount heap dump directory to host for dev analysis. volumes: - type: bind source: ./tmp/heap-dumps target: /var/tmp/heap bind: create_host_path: true