diff --git a/Dockerfile b/Dockerfile index 8ca9fd711a0f2a742e27c286b0ed4a27aa127fe3..e5fb44da96b3fef9b31b75fd96428a1ba4b94a54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ -FROM golang as builder +FROM golang:alpine as builder +RUN apk add --no-cache curl git gcc musl-dev RUN curl https://glide.sh/get | sh WORKDIR /go/src/app @@ -8,6 +9,7 @@ RUN glide install RUN CGO_ENABLED=false go build -a app . FROM alpine:3.7 -WORKDIR /root/ -COPY --from=builder /go/src/app/app . -CMD ["./app"] \ No newline at end of file +WORKDIR / +COPY --from=builder /go/src/app/app /app +COPY --from=builder /go/src/app/static /static +CMD ["/app"] \ No newline at end of file diff --git a/main.go b/main.go index 8342231db054e5fd89b8301f16970e516e6ef903..42264535aad6274d3e2ba760f0d5f3db234d3837 100644 --- a/main.go +++ b/main.go @@ -80,7 +80,7 @@ func returnResult(writer http.ResponseWriter, result Result) error { writer.Write([]byte("</pre>")) if result.Success { writer.Write([]byte("<p><a href=\"")) - writer.Write([]byte(fmt.Sprintf("http://localhost:8080/i/%s", result.Id))) + writer.Write([]byte(fmt.Sprintf("https://i.k8r.eu/i/%s", result.Id))) writer.Write([]byte("\">Uploaded Image</a></p>")) } return nil @@ -94,6 +94,7 @@ func main() { config.SourceFolder = os.Getenv("IK8R_SOURCE_FOLDER") config.TargetFolder = os.Getenv("IK8R_TARGET_FOLDER") config.Redis.Address = os.Getenv("IK8R_REDIS_ADDRESS") + config.Redis.Password = os.Getenv("IK8R_REDIS_PASSWORD") config.ImageQueue = os.Getenv("IK8R_REDIS_IMAGE_QUEUE") config.ResultChannel = os.Getenv("IK8R_REDIS_RESULT_CHANNEL")