diff --git a/cmd/rdpgw/api/web.go b/cmd/rdpgw/api/web.go
index b1da3ab42b55a2679b47a90722a52e4674979276..d02f5c393911b290f7c6b3671c23e7bc31f45380 100644
--- a/cmd/rdpgw/api/web.go
+++ b/cmd/rdpgw/api/web.go
@@ -44,7 +44,7 @@ type Config struct {
 	stateStore           *cache.Cache
 	Hosts                []string
 	HostSelection        string
-	GatewayAddress       string
+	GatewayAddress       *url.URL
 	UsernameTemplate     string
 	NetworkAutoDetect    int
 	BandwidthAutoDetect  int
@@ -276,7 +276,7 @@ func (c *Config) HandleDownload(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Content-Disposition", "attachment; filename="+fn)
 	w.Header().Set("Content-Type", "application/x-rdp")
 	data := "full address:s:" + host + "\r\n" +
-		"gatewayhostname:s:" + c.GatewayAddress + "\r\n" +
+		"gatewayhostname:s:" + c.GatewayAddress.Host + "\r\n" +
 		"gatewaycredentialssource:i:5\r\n" +
 		"gatewayusagemethod:i:1\r\n" +
 		"gatewayprofileusagemethod:i:1\r\n" +
diff --git a/cmd/rdpgw/main.go b/cmd/rdpgw/main.go
index c6cdbf062a65ceb503e231a06cb76abb1ff0a9cf..9850f5ceac87fdf48100b6a0f1a4906628991510 100644
--- a/cmd/rdpgw/main.go
+++ b/cmd/rdpgw/main.go
@@ -88,7 +88,7 @@ func main() {
 			url.Scheme = "https"
 		}
 		url.Path = "callback"
-		api.GatewayAddress = url.String()
+		api.GatewayAddress = url
 
 		oauthConfig := oauth2.Config{
 			ClientID:     conf.OpenId.ClientId,
diff --git a/dev/docker/Dockerfile b/dev/docker/Dockerfile
index 7497cb8eb8698543bf1b66207722c09715ba55c4..336b379e2fd6d3d372bcd5c047d2337c471e63c5 100644
--- a/dev/docker/Dockerfile
+++ b/dev/docker/Dockerfile
@@ -30,6 +30,9 @@ RUN git clone https://github.com/bolkedebruin/rdpgw.git /app && \
 
 FROM scratch
 
+# make tempdir in case filestore is used
+ADD tmp.tar /
+
 COPY --from=builder /opt/rdpgw /opt/rdpgw
 COPY --from=builder /etc/passwd /etc/passwd
 COPY --from=builder /etc/ssl/certs /etc/ssl/certs
diff --git a/dev/docker/tmp.tar b/dev/docker/tmp.tar
new file mode 100644
index 0000000000000000000000000000000000000000..ee83747f6d085188eba2d5164c43f22b52571059
Binary files /dev/null and b/dev/docker/tmp.tar differ