diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b8ae7e7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM golang:alpine AS builder +WORKDIR /app +COPY . . +RUN go build -o main . + + +FROM alpine:latest +WORKDIR /app +COPY --from=builder /app/main /app/main +COPY --from=builder /app/templates /app/templates +EXPOSE 8181 +CMD ["/app/main"] diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..8d19730 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module tma + +go 1.25.0 diff --git a/main b/main new file mode 100644 index 0000000..e65e288 Binary files /dev/null and b/main differ diff --git a/main.go b/main.go index 6fc7783..5257959 100644 --- a/main.go +++ b/main.go @@ -72,7 +72,7 @@ func main() { http.NotFound(w, r) }) - port := ":8080" + port := ":8181" fmt.Printf("Starting Go server on http://localhost%s\n", port) fmt.Printf("Open http://localhost%s in your browser\n", port) fmt.Printf("Serving files directly from templates directory\n")