From c98ff4b715a050cf9dd0458f1a8ba7394cdfbd81 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Apr 2014 19:42:54 -0400 Subject: refactor --- config-joey.hs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/config-joey.hs b/config-joey.hs index baabd8cb..525f9d72 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -63,24 +63,20 @@ host _ = Nothing container :: HostName -> Docker.ContainerName -> Maybe (Docker.Container) container _parenthost name -- Simple web server, publishing the outside host's /var/www - | name == "webserver" = Just $ Docker.containerFrom - (image $ System (Debian Unstable) "amd64") + | name == "webserver" = Just $ standardContainer Stable "amd64" [ Docker.publish "8080:80" , Docker.volume "/var/www:/var/www" , Docker.inside $ props & Apt.serviceInstalledRunning "apache2" - & Apt.unattendedUpgrades ] -- My own openid provider. Uses php, so containerized for security -- and administrative sanity. - | name == "openid-provider" = Just $ Docker.containerFrom - (image $ System (Debian Stable) "amd64") + | name == "openid-provider" = Just $ standardContainer Stable "amd64" [ Docker.publish "8081:80" , Docker.inside $ props - & Apt.stdSourcesList Stable - & Apt.unattendedUpgrades - & OpenId.providerFor ["joey", "liw"] "openid.kitenet.net:8081" + & OpenId.providerFor ["joey", "liw"] + "openid.kitenet.net:8081" ] -- armel builder has a companion container that run amd64 and @@ -147,6 +143,15 @@ standardSystem suite customprops = Just $ -- Currently not enable due to #726375 endprops = [] -- [Apt.installed ["systemd-sysv"] `onChange` Reboot.now] +-- This is my standard container setup. +standardContainer :: DebianSuite -> Architecture -> [Docker.Containerized Property] -> Docker.Container +standardContainer suite arch ps = Docker.containerFrom + (image $ System (Debian suite) arch) $ + [ Docker.inside $ props + & Apt.stdSourcesList suite + & Apt.unattendedUpgrades + ] ++ ps + -- Clean up a system as installed by cloudatcost.com cleanCloudAtCost :: HostName -> Property cleanCloudAtCost hostname = propertyList "cloudatcost cleanup" -- cgit v1.2.3