-
Notifications
You must be signed in to change notification settings - Fork 2
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 #22 from ispiroglu/tiny-refactors
Tiny refactors
- Loading branch information
Showing
31 changed files
with
1,345 additions
and
347 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,32 @@ | ||
# Include any files or directories that you don't want to be copied to your | ||
# container here (e.g., local build artifacts, temporary files, etc.). | ||
# | ||
# For more help, visit the .dockerignore file reference guide at | ||
# https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
|
||
**/.DS_Store | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
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 |
---|---|---|
@@ -1,9 +1,41 @@ | ||
FROM golang:alpine3.18 as build | ||
WORKDIR /go/src/app | ||
COPY . . | ||
RUN mkdir /go/bin/app | ||
RUN go build -o /go/bin/app/ -v ./cmd/mercurius | ||
|
||
FROM alpine:3.18 | ||
COPY --from=build /go/bin/app /app | ||
ENTRYPOINT ["/app/mercurius"] | ||
ARG GO_VERSION=1.21 | ||
FROM golang:${GO_VERSION} AS build | ||
WORKDIR /src | ||
|
||
RUN --mount=type=cache,target=/go/pkg/mod/ \ | ||
--mount=type=bind,source=go.sum,target=go.sum \ | ||
--mount=type=bind,source=go.mod,target=go.mod \ | ||
go mod download -x | ||
|
||
RUN --mount=type=cache,target=/go/pkg/mod/ \ | ||
--mount=type=bind,target=. \ | ||
CGO_ENABLED=0 go build -o /bin/server ./cmd/mercurius/ | ||
|
||
FROM alpine:latest AS final | ||
|
||
RUN --mount=type=cache,target=/var/cache/apk \ | ||
apk --update add \ | ||
ca-certificates \ | ||
tzdata \ | ||
&& \ | ||
update-ca-certificates | ||
|
||
ARG UID=10001 | ||
RUN adduser \ | ||
--disabled-password \ | ||
--gecos "" \ | ||
--home "/nonexistent" \ | ||
--shell "/sbin/nologin" \ | ||
--no-create-home \ | ||
--uid "${UID}" \ | ||
appuser | ||
USER appuser | ||
|
||
COPY --from=build /bin/server /bin/ | ||
|
||
EXPOSE 9000 | ||
EXPOSE 6060 | ||
EXPOSE 8081 | ||
EXPOSE 8080 | ||
|
||
ENTRYPOINT [ "/bin/server" ] |
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,15 @@ | ||
package client_example | ||
|
||
import "time" | ||
|
||
const PublisherCount = 1 | ||
const PublishCount = 100 | ||
|
||
var TotalPublishCount = uint64(PublisherCount * PublishCount) | ||
|
||
const SubscriberCount = 1 | ||
|
||
var TotalReceiveCount = TotalPublishCount * SubscriberCount | ||
var StartTime time.Time | ||
|
||
const StreamPerSubscriber int = 5 |
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,19 @@ | ||
services: | ||
server: | ||
build: | ||
context: . | ||
target: final | ||
ports: | ||
- 9000:9000 | ||
- 6060:6060 | ||
- 8081:8081 | ||
- 8080:8080 | ||
prometheus: | ||
image: prom/prometheus | ||
ports: | ||
- 9090:9090 | ||
command: | ||
- --web.enable-remote-write-receiver | ||
- --enable-feature=exemplar-storage | ||
volumes: | ||
- ./prometheus/prometheus.yml:/prometheus/prometheus.yml |
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,6 @@ | ||
go 1.21.5 | ||
|
||
use ( | ||
. | ||
./test/kafka-cmp | ||
) |
Oops, something went wrong.