diff --git a/Dockerfile b/Dockerfile index 975cfad..15c4832 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ -FROM docker.io/golang:1.23 as build +FROM docker.io/golang:1.23 AS build +WORKDIR /build/ +COPY go.mod go.sum . +RUN go mod download COPY src/ . -RUN printf 'module yw5n\ngo 1.23' > go.mod && CGO_ENABLED=0 go build -o /app +RUN CGO_ENABLED=0 go build -o /app FROM scratch COPY --from=build /app /app diff --git a/compose.yaml b/compose.yaml index 89ab5a7..d966985 100644 --- a/compose.yaml +++ b/compose.yaml @@ -4,3 +4,10 @@ services: build: . ports: - "3000:3000" + develop: + watch: + - action: rebuild + path: src/ + - action: sync+restart + path: html/ + target: /html diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..3a3a5a6 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module main + +go 1.23.3 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..e69de29 diff --git a/html/about.html b/html/about.html index 9ff6258..1af3590 100644 --- a/html/about.html +++ b/html/about.html @@ -8,7 +8,7 @@