-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
277 additions
and
75 deletions.
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,22 @@ | ||
## build Go executable | ||
FROM golang:1.19-alpine as go-build | ||
|
||
## copy entire local folder to container root directory | ||
COPY ./ /mqtt-gateway/ | ||
|
||
WORKDIR /mqtt-gateway/cmd/gateway | ||
|
||
## build | ||
RUN go build -v | ||
|
||
## deploy | ||
FROM alpine:3.17.0 | ||
|
||
## copy executable from go-build container | ||
COPY --from=go-build /mqtt-gateway/cmd/gateway/gateway /app/gateway | ||
|
||
## http port | ||
EXPOSE 50000 | ||
|
||
## entrypoint is gateway | ||
ENTRYPOINT ["/app/gateway", "-httpHost", ""] |
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
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
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
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,16 @@ | ||
// Package devices provides the pico-cs device and configuration types. | ||
package devices | ||
|
||
import ( | ||
"net/http" | ||
"strings" | ||
) | ||
|
||
// ident for json marshalling. | ||
var indent = strings.Repeat(" ", 4) | ||
|
||
// HTTPHandler is a anlder function providing the main html index for the devices. | ||
func HTTPHandler(w http.ResponseWriter, r *http.Request) { | ||
w.Header().Set("Access-Control-Allow-Origin", "*") | ||
w.Write([]byte(idxHTML)) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.