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