~dricottone/simple-chat

c2c030fb4be52336a6e5ab71fede805e836b6d98 — Dominic Ricottone 1 year, 16 days ago f64ce77 v1.0.1
Updates and reorganization

Updated dependency and go versions.

Reworked the Makefile recipes.

Extracted the container image recipe from this repository. See
https://git.dominic-ricottone.com/~dricottone/container-images/tree/dev/item/simple-chat/README.md .
4 files changed, 20 insertions(+), 32 deletions(-)

D Dockerfile
M Makefile
M server/Makefile
M server/go.mod
D Dockerfile => Dockerfile +0 -12
@@ 1,12 0,0 @@
FROM golang:alpine

WORKDIR /app
COPY server/* ./
RUN go mod download
RUN go build -o /app/server-bin

EXPOSE 8080
RUN adduser -H -D -u 1001 me
USER me:me
CMD [ "/app/server-bin" ]


M Makefile => Makefile +3 -12
@@ 1,13 1,4 @@
CONMAN=sudo docker

.PHONY: clean
clean:
	$(CONMAN) image rm --force my-chat || true


.PHONY: image
image:
	#cd server && make build
	$(CONMAN) build --tag my-chat .

server:
	cd server && make clean && make go.mod && make server

.PHONY: server

M server/Makefile => server/Makefile +11 -5
@@ 1,9 1,15 @@
.PHONY: clean
clean:
	rm -f server go.sum
	rm -f server
	rm -f go.mod

.PHONY: build
build: clean
	go get -u
go.mod:
	go mod init git.dominic-ricottone.com/~dricottone/simple-chat/server
	go get github.com/gorilla/websocket

server:
	go mod download
	go build

build: server

.PHONY: clean build

M server/go.mod => server/go.mod +6 -3
@@ 1,5 1,8 @@
module git.dominic-ricottone.com/simple-chat/server
module git.dominic-ricottone.com/~dricottone/simple-chat/server

go 1.18
go 1.21.4

require github.com/gorilla/websocket v1.5.0
require (
	github.com/gorilla/websocket v1.5.1 // indirect
	golang.org/x/net v0.17.0 // indirect
)