diff --git a/api/cli/cli.go b/api/cli/cli.go index ccd9c1f9a..10f476c9b 100644 --- a/api/cli/cli.go +++ b/api/cli/cli.go @@ -25,14 +25,14 @@ func (*Service) ParseFlags(version string) (*portainer.CLIFlags, error) { Endpoint: kingpin.Flag("host", "Dockerd endpoint").Short('H').String(), Logo: kingpin.Flag("logo", "URL for the logo displayed in the UI").String(), Labels: pairs(kingpin.Flag("hide-label", "Hide containers with a specific label in the UI").Short('l')), - Addr: kingpin.Flag("bind", "Address and port to serve Portainer").Default(":9000").Short('p').String(), - Assets: kingpin.Flag("assets", "Path to the assets").Default(".").Short('a').String(), - Data: kingpin.Flag("data", "Path to the folder where the data is stored").Default("/data").Short('d').String(), - Templates: kingpin.Flag("templates", "URL to the templates (apps) definitions").Default("https://raw.githubusercontent.com/portainer/templates/master/templates.json").Short('t').String(), - TLSVerify: kingpin.Flag("tlsverify", "TLS support").Default("false").Bool(), - TLSCacert: kingpin.Flag("tlscacert", "Path to the CA").Default("/certs/ca.pem").String(), - TLSCert: kingpin.Flag("tlscert", "Path to the TLS certificate file").Default("/certs/cert.pem").String(), - TLSKey: kingpin.Flag("tlskey", "Path to the TLS key").Default("/certs/key.pem").String(), + Addr: kingpin.Flag("bind", "Address and port to serve Portainer").Default(defaultBindAddress).Short('p').String(), + Assets: kingpin.Flag("assets", "Path to the assets").Default(defaultAssetsDirectory).Short('a').String(), + Data: kingpin.Flag("data", "Path to the folder where the data is stored").Default(defaultDataDirectory).Short('d').String(), + Templates: kingpin.Flag("templates", "URL to the templates (apps) definitions").Default(defaultTemplatesURL).Short('t').String(), + TLSVerify: kingpin.Flag("tlsverify", "TLS support").Default(defaultTLSVerify).Bool(), + TLSCacert: kingpin.Flag("tlscacert", "Path to the CA").Default(defaultTLSCACertPath).String(), + TLSCert: kingpin.Flag("tlscert", "Path to the TLS certificate file").Default(defaultTLSCertPath).String(), + TLSKey: kingpin.Flag("tlskey", "Path to the TLS key").Default(defaultTLSKeyPath).String(), } kingpin.Parse() diff --git a/api/cli/defaults.go b/api/cli/defaults.go new file mode 100644 index 000000000..adf8affbf --- /dev/null +++ b/api/cli/defaults.go @@ -0,0 +1,14 @@ +// +build !windows + +package cli + +const ( + defaultBindAddress = ":9000" + defaultDataDirectory = "/data" + defaultAssetsDirectory = "." + defaultTemplatesURL = "https://raw.githubusercontent.com/portainer/templates/master/templates.json" + defaultTLSVerify = "false" + defaultTLSCACertPath = "/certs/ca.pem" + defaultTLSCertPath = "/certs/cert.pem" + defaultTLSKeyPath = "/certs/key.pem" +) diff --git a/api/cli/defaults_windows.go b/api/cli/defaults_windows.go new file mode 100644 index 000000000..3a4106c74 --- /dev/null +++ b/api/cli/defaults_windows.go @@ -0,0 +1,12 @@ +package cli + +const ( + defaultBindAddress = ":9000" + defaultDataDirectory = "C:\\data" + defaultAssetsDirectory = "." + defaultTemplatesURL = "https://raw.githubusercontent.com/portainer/templates/master/templates.json" + defaultTLSVerify = "false" + defaultTLSCACertPath = "C:\\certs\\ca.pem" + defaultTLSCertPath = "C:\\certs\\cert.pem" + defaultTLSKeyPath = "C:\\certs\\key.pem" +) diff --git a/build/windows/microsoftservercore/Dockerfile b/build/windows/microsoftservercore/Dockerfile index 23e75264f..dfcd8b15a 100644 --- a/build/windows/microsoftservercore/Dockerfile +++ b/build/windows/microsoftservercore/Dockerfile @@ -2,6 +2,8 @@ FROM microsoft/windowsservercore COPY dist / +VOLUME C:\\data + WORKDIR / EXPOSE 9000 diff --git a/build/windows/nanoserver/Dockerfile b/build/windows/nanoserver/Dockerfile index d4aa2d657..ae8a25a39 100644 --- a/build/windows/nanoserver/Dockerfile +++ b/build/windows/nanoserver/Dockerfile @@ -2,6 +2,8 @@ FROM microsoft/nanoserver COPY dist / +VOLUME C:\\data + WORKDIR / EXPOSE 9000