-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from gianrubio/branch/dockerize
dockerize app
- Loading branch information
Showing
4 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.* | ||
vendor | ||
Dockerfile | ||
Makefile | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM golang:alpine | ||
|
||
#RUN apt-get update &&\ | ||
# rm -rf /var/lib/apt/lists | ||
RUN apk --no-cache --update add git ca-certificates | ||
WORKDIR $GOPATH/src/app/ | ||
ADD . . | ||
RUN go get -v | ||
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o nginx-vts-exporter . | ||
RUN mv $GOPATH/src/app/nginx-vts-exporter / | ||
COPY ./docker-entrypoint.sh / | ||
|
||
EXPOSE 9113 | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
CMD ["/nginx-vts-exporter"] | ||
#, "-nginx.scrape_uri=http://localhost/status/format/json"] | ||
|
||
#CMD ["$GOPATH/src/app/nginx-vts-exporter"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
set -eo pipefail | ||
|
||
# If there are any arguments then we want to run those instead | ||
if [[ "$1" == "/nginx-vts-exporter" || -z $1 ]]; then | ||
exec "$@" | ||
#$GOPATH/src/app/nginx-vts-exporter | ||
else | ||
exec "/nginx-vts-exporter" "$@" | ||
fi |