add docker

This commit is contained in:
Smile Rex
2026-01-09 22:51:25 +03:00
parent 6e7faff43c
commit 29052f2c43
4 changed files with 16 additions and 1 deletions

12
Dockerfile Normal file
View File

@@ -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"]

3
go.mod Normal file
View File

@@ -0,0 +1,3 @@
module tma
go 1.25.0

BIN
main Normal file

Binary file not shown.

View File

@@ -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")