~dricottone/simple-chat

11a6d556c1f8edfa3e9d65b2f4af90aceec1147b — Dominic Ricottone 2 years ago ee1987a
Update port to 8080
4 files changed, 13 insertions(+), 6 deletions(-)

M Dockerfile
M Makefile
M server/Makefile
M server/main.go
M Dockerfile => Dockerfile +1 -1
@@ 5,7 5,7 @@ COPY server/* ./
RUN go mod download
RUN go build -o /app/server-bin

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

M Makefile => Makefile +9 -2
@@ 1,6 1,13 @@
.PHONY: image
CONMAN=docker

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


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



M server/Makefile => server/Makefile +2 -2
@@ 1,8 1,8 @@
.PHONY: clean build

.PHONY: clean
clean:
	rm -f server go.sum

.PHONY: build
build: clean
	go get -u
	go build

M server/main.go => server/main.go +1 -1
@@ 118,7 118,7 @@ func main() {
	})

	// Run server
	err := http.ListenAndServe(":40080", nil)
	err := http.ListenAndServe(":8080", nil)
	if err != nil {
		log.Println("while running server:", err)
	}