Include `-m` flag in `docker run` call to limit memory per container

As per Docker run documentation (https://docs.docker.com/config/containers/resource_constraints/#limit-a-containers-access-to-memory), the `-m` flag must be set in order for `--oom-kill-disable` to have the intended effect. Otherwise, an exhaustion of memory in the container will put pressure on the host's processes. This commit sets the max memory to 200MB assuming the t3.small instance has 2GB total.
This commit is contained in:
Shaunak G 2021-07-27 10:05:13 +10:00 committed by GitHub
parent 886579669e
commit 956624c10d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -349,6 +349,7 @@ func (sv *supervisor) reload() error {
"-p", fmt.Sprintf("127.0.0.1:%d:6119", port),
"-e", "FATHOM_SITE_ID",
"-e", "RIJU_DEPLOY_CONFIG",
"-m", "200m",
"--label", fmt.Sprintf("riju.deploy-config-hash=%s", deployCfgHash),
"--name", name,
"--restart", "unless-stopped",