Skip to content

Commit

Permalink
fix panic when websocket fails multiple times + add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Issif committed Apr 15, 2020
1 parent 73ad921 commit 40cbd0f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Build image (Golang)
FROM golang:alpine AS build-stage
ENV GO111MODULE on
ENV CGO_ENABLED 0

RUN apk add --no-cache gcc git make

WORKDIR /src
ADD . .

RUN go mod download
RUN go build -ldflags="-s -w" -o cercat

# Final Docker image
FROM alpine AS final-stage
LABEL MAINTAINER "Thomas Labarussias <issif+github@gadz.org>"

RUN apk add --no-cache ca-certificates

# Create user falcosidekick
RUN addgroup -S cercat && adduser -u 1234 -S cercat -G cercat
USER 1234

WORKDIR ${HOME}/
COPY --from=build-stage /src/cercat .

EXPOSE 2801

ENTRYPOINT ["./cercat"]
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func main() {
_, msg, err := ws.ReadMessage()
if err != nil {
log.Println("[ERROR] : Error reading message")
continue
break
}
msgChan <- msg
}
Expand Down

0 comments on commit 40cbd0f

Please sign in to comment.