Skip to content

Commit

Permalink
Merge pull request #3 from harisheoran/kafka
Browse files Browse the repository at this point in the history
fix: Dockerfile ca cert
  • Loading branch information
harisheoran authored Dec 12, 2024
2 parents dfb1ac4 + 38a2005 commit 0762998
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
1 change: 1 addition & 0 deletions chat-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ WORKDIR /app

COPY --from=build /app/bin/my-chat-system-server /app/bin/my-chat-system-server
COPY --from=build /app/ui /app/ui
COPY --from=build /app/ca.pem /app/ca.pem

RUN chmod +x /app/bin/my-chat-system-server

Expand Down
25 changes: 25 additions & 0 deletions chat-server/Dockerfile-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM golang:1.23.3 as build

WORKDIR /app

COPY go.mod go.sum ./

RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /app/bin/my-chat-system-server ./cmd/server

FROM ubuntu:24.10 as prod

WORKDIR /app

COPY --from=build /app/bin/my-chat-system-server /app/bin/my-chat-system-server
COPY --from=build /app/ui /app/ui
COPY --from=build /app/ca.pem /app/ca.pem

RUN chmod +x /app/bin/my-chat-system-server

EXPOSE 1316

ENTRYPOINT [ "/app/bin/my-chat-system-server" ]
Binary file modified chat-server/bin/api
Binary file not shown.
5 changes: 5 additions & 0 deletions chat-server/cmd/server/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,8 @@ func (app *app) produceToKafka() {
}

// consume message from kafka
func (app *app) consumeFromKafka() {
for {

}
}
3 changes: 1 addition & 2 deletions chat-server/cmd/server/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ func (app *app) kafkaInitialize() (*kafka.Dialer, error) {
}

tlsConfig := &tls.Config{
RootCAs: caCertPool,
InsecureSkipVerify: false, // Ensure this is false in production.
RootCAs: caCertPool,
}
scram, err := scram.Mechanism(scram.SHA512, username, password)
if err != nil {
Expand Down

0 comments on commit 0762998

Please sign in to comment.