Mounts
Mount files and directories of your code into a service.
mounts put a file or directory of /data/app at another path inside a service's
container. Use them for a configuration file a program expects at a fixed path, or to give a container service part of
your code.
services:
proxy:
type: container
image: registry.example.com/team/proxy@sha256:4f1c2b…
mounts:
- from: config/proxy.conf
to: /etc/proxy/proxy.conf
- from: public
to: /srv/wwwfromis relative to/data/appand must stay inside it.tois an absolute path in the container.- Targets under
/data,/nix,/run/harthelm,/home/harthelmand/etc/harthelmare refused.
Sync after you add or change mounts.
steps and container services
A steps service sees all of /data/app anyway; a mount only puts part of it at another path as well. A container
service sees nothing of /data/app except what you mount.
Edits to a mounted file
Changes to a mounted directory show in the container at once. A mounted single file is different: an editor that saves by writing a new file and renaming it, as many do, replaces the file on disk, and the container keeps seeing the old one until its pod restarts. Restart the service after such an edit, or mount the file's directory instead.
Errors
The code mount names a mount that leaves /data/app or targets a reserved path; the Sync stops with the line and
column. See harthelm.yml errors.