From 391bd6c576d3c7023224f2a3ddfd3ebb8d7056ae Mon Sep 17 00:00:00 2001 From: Clement Michaud Date: Fri, 1 Nov 2019 21:15:58 +0100 Subject: [PATCH] Move authelia entrypoint to cmd/authelia directory. --- .gitignore | 3 --- Dockerfile | 4 ++-- cmd/authelia-scripts/cmd_build.go | 3 ++- main.go => cmd/authelia/main.go | 0 4 files changed, 4 insertions(+), 6 deletions(-) rename main.go => cmd/authelia/main.go (100%) diff --git a/.gitignore b/.gitignore index 9db836bce..bce5b61f1 100644 --- a/.gitignore +++ b/.gitignore @@ -41,7 +41,4 @@ users_database.test.yml .kube .idea -# Go binary -authelia - .authelia-interrupt diff --git a/Dockerfile b/Dockerfile index f1f4852fd..e6b3bee3a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /go/src/app COPY . . # CGO_ENABLED=1 is mandatory for building go-sqlite3 -RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o authelia +RUN cd cmd/authelia && GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o authelia # ======================================== @@ -33,7 +33,7 @@ RUN apk --no-cache add ca-certificates tzdata WORKDIR /usr/app -COPY --from=builder-backend /go/src/app/authelia authelia +COPY --from=builder-backend /go/src/app/cmd/authelia/authelia authelia COPY --from=builder-frontend /node/src/app/build public_html EXPOSE 9091 diff --git a/cmd/authelia-scripts/cmd_build.go b/cmd/authelia-scripts/cmd_build.go index 3a02b4876..8023cd1eb 100644 --- a/cmd/authelia-scripts/cmd_build.go +++ b/cmd/authelia-scripts/cmd_build.go @@ -8,7 +8,8 @@ import ( ) func buildAutheliaBinary() { - cmd := CommandWithStdout("go", "build", "-o", OutputDir+"/authelia") + cmd := CommandWithStdout("go", "build", "-o", "../../"+OutputDir+"/authelia") + cmd.Dir = "cmd/authelia" cmd.Env = append(os.Environ(), "GOOS=linux", "GOARCH=amd64", "CGO_ENABLED=1") diff --git a/main.go b/cmd/authelia/main.go similarity index 100% rename from main.go rename to cmd/authelia/main.go