From ba597d5ab832f925cf67b786c438545a03264ff2 Mon Sep 17 00:00:00 2001 From: Dominic Ricottone Date: Sat, 11 Nov 2023 21:00:29 -0600 Subject: [PATCH] Added simple-chat --- README.md | 1 + simple-chat/.gitignore | 3 +++ simple-chat/Dockerfile | 17 +++++++++++++++++ simple-chat/Makefile | 15 +++++++++++++++ simple-chat/README.md | 27 +++++++++++++++++++++++++++ 5 files changed, 63 insertions(+) create mode 100644 simple-chat/.gitignore create mode 100644 simple-chat/Dockerfile create mode 100644 simple-chat/Makefile create mode 100644 simple-chat/README.md diff --git a/README.md b/README.md index f05c8c0..d763a73 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ It should be easy to get things working on another build system. |[php](/~dricottone/container-images/tree/dev/item/php/README.md)|latest,readwrite,fpm,development,fpm-development|`registry.intra.dominic-ricottone.com/php:latest`| |[postfix](/~dricottone/container-images/tree/dev/item/postfix/README.md)|latest,tls-in,tls-out|`registry.intra.dominic-ricottone.com/postfix:latest`| |[promtail](/~dricottone/container-images/tree/dev/item/promtail/README.md)|latest|`registry.intra.dominic-ricottone.com/promtail:latest`| +|[simple-chat](/~dricottone/container-images/tree/dev/item/simple-chat/README.md)|latest|`registry.intra.dominic-ricottone.com/simple-chat:latest`| |[srht-core](/~dricottone/container-images/tree/dev/item/srht-core/README.md)|latest|`registry.intra.dominic-ricottone.com/srht-core:latest`| |[srht-git-api](/~dricottone/container-images/tree/dev/item/srht-git-api/README.md)|latest|`registry.intra.dominic-ricottone.com/srht-git-api:latest`| |[srht-git-core](/~dricottone/container-images/tree/dev/item/srht-git-core/README.md)|latest|`registry.intra.dominic-ricottone.com/srht-git-core:latest`| diff --git a/simple-chat/.gitignore b/simple-chat/.gitignore new file mode 100644 index 0000000..cd54953 --- /dev/null +++ b/simple-chat/.gitignore @@ -0,0 +1,3 @@ +simple-chat.tar.gz +simple-chat-v1.0.1 + diff --git a/simple-chat/Dockerfile b/simple-chat/Dockerfile new file mode 100644 index 0000000..f1a0044 --- /dev/null +++ b/simple-chat/Dockerfile @@ -0,0 +1,17 @@ +FROM docker.io/library/golang:alpine as builder +WORKDIR /app +COPY simple-chat-v1.0.1/server/* ./ + +RUN apk add make +RUN make clean && make go.mod && make server + +FROM docker.io/library/alpine:latest +WORKDIR /app +COPY --from=builder /app/server /app/server + +RUN adduser -H -D -u 1001 me +USER me:me + +EXPOSE 8080 +CMD [ "/app/server-bin" ] + diff --git a/simple-chat/Makefile b/simple-chat/Makefile new file mode 100644 index 0000000..1ac374a --- /dev/null +++ b/simple-chat/Makefile @@ -0,0 +1,15 @@ +CONMAN=sudo docker + +REGISTRY=registry.intra.dominic-ricottone.com +IMAGE=simple-chat +TAG=latest + +image: + curl -o simple-chat.tar.gz https://git.dominic-ricottone.com/~dricottone/simple-chat/archive/v1.0.1.tar.gz + untar simple-chat.tar.gz + $(CONMAN) buildx build --push \ + --platform linux/arm64,linux/amd64 \ + --tag $(REGISTRY)/$(IMAGE):$(TAG) \ + . + +.PHONY: image diff --git a/simple-chat/README.md b/simple-chat/README.md new file mode 100644 index 0000000..3f7ccfe --- /dev/null +++ b/simple-chat/README.md @@ -0,0 +1,27 @@ +# simple-chat + + +## Build and Deploy + +``` +make image +``` + + +### Tags + + + `latest` + +---- + +## Use + +Can be used with any container manager toolchain. + +Try: + +``` +$conman run --detach --name nginx --restart always \ + registry.intra.dominic-ricottone.com/simple-chat:latest +``` + -- 2.45.2