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
+)