Changeset f99bbe8 in Klonkt for docker-compose.yml


Ignore:
Timestamp:
06/23/2026 10:00:00 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
5eef817
Parents:
09ee2bd
Message:

security: bind to 127.0.0.1 by default behind a reverse proxy

New HOST env (default 0.0.0.0 for Docker/back-compat). The VPS installer now
writes HOST=127.0.0.1 and Docker maps the host port to loopback (127.0.0.1:3000:3000)
+ overrides HOST=0.0.0.0 inside the container — so the app is never reachable
directly on its port from the internet, only via the proxy. .env.example defaults
to 127.0.0.1 (manual installs); docs explain it. Existing installs hardened on
re-run of install.sh.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docker-compose.yml

    r09ee2bd rf99bbe8  
    1616    env_file: .env
    1717    environment:
    18       # In de container draait 'ie altijd op 3000 en in productie-modus,
    19       # ongeacht wat er in .env staat.
     18      # Inside the container it always runs on port 3000 in production mode and
     19      # binds all interfaces (so the port mapping works) — overrides .env. The
     20      # loopback host-mapping below is what keeps it off the public internet.
    2021      NODE_ENV: production
    2122      PORT: "3000"
     23      HOST: "0.0.0.0"
    2224    ports:
    23       # host:container — wijzig de host-poort (links) als 3000 al bezet is.
    24       - "3000:3000"
     25      # Bind the host port to loopback only — reach the app through your reverse
     26      # proxy (Caddy/nginx) on this host, not directly from the internet.
     27      # Change the left side if 3000 is taken, e.g. "127.0.0.1:3001:3000".
     28      - "127.0.0.1:3000:3000"
    2529    volumes:
    26       # Alle data (database, geüploade media + audio) blijft hier bewaard.
     30      # All data (database, uploaded media + audio) is kept here.
    2731      - klonkt-data:/app/storage
    2832
Note: See TracChangeset for help on using the changeset viewer.