about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-01-28T16·47+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-01-28T16·47+0000
commitff06ffcf9cd8ad78f0dcc7df4e6bbfa684e73f1e (patch)
tree5448afc53fcb961716ee44f329894b95f7c78477
parentbacaa0ca8ad26b4f7ff592746d63d5c6b6c39ab0 (diff)
Package depot's gemma as a docker image for Cloud Run
Using <depot>'s gemma project with `dockerTools.buildLayeredImage` because I
need access to a nix-packaged server and gemma is the first thing that comes to
mind.
-rw-r--r--docker/cloud_run.nix17
-rw-r--r--docker/config.lisp21
2 files changed, 34 insertions, 4 deletions
diff --git a/docker/cloud_run.nix b/docker/cloud_run.nix
index 02440df08872..70be4040c36b 100644
--- a/docker/cloud_run.nix
+++ b/docker/cloud_run.nix
@@ -1,9 +1,18 @@
-# Attempting to build a Docker image with Nix to run using Google Cloud Run.
-{ pkgs ? import <nixpkgs> {}, ... }:
+{
+  pkgs ? import <nixpkgs> {},
+  depot ? import <depot> {},
+  ...
+}:
 
 pkgs.dockerTools.buildLayeredImage {
-  name = "mysql";
+  name = "gemma";
   tag = "latest";
-  config.Cmd = [ "${pkgs.mysql}/bin/mysqld" ];
+  config.ExposedPorts = {
+    "4242" = {};
+  };
+  config.Env = [
+    "GEMMA_CONFIG=${./config.lisp}"
+  ];
+  config.Cmd = [ "${depot.fun.gemma}/bin/gemma" ];
   maxLayers = 120;
 }
diff --git a/docker/config.lisp b/docker/config.lisp
new file mode 100644
index 000000000000..54f8e5f34462
--- /dev/null
+++ b/docker/config.lisp
@@ -0,0 +1,21 @@
+;; Example configuration file for Gemma
+
+(config :port 4242
+        :data-dir "/tmp/gemma/")
+
+(deftask bathroom/wipe-mirror 7)
+(deftask bathroom/wipe-counter 7)
+
+;; Bedroom tasks
+(deftask bedroom/change-sheets 7)
+(deftask bedroom/vacuum 10)
+
+;; Kitchen tasks
+(deftask kitchen/normal-trash 3)
+(deftask kitchen/green-trash 5)
+(deftask kitchen/blue-trash 5)
+(deftask kitchen/wipe-counters 3)
+(deftask kitchen/vacuum 5 "Kitchen has more crumbs and such!")
+
+;; Entire place
+(deftask clean-windows 60)