FROM golang:1.20
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64
WORKDIR /server
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY cmd ./cmd/
COPY pkg ./pkg/
COPY .env .
RUN go get github.com/githubnemo/CompileDaemon
RUN go install github.com/githubnemo/CompileDaemon
ENTRYPOINT CompileDaemon -polling -log-prefix=false -build="go build -o bin/app ./cmd/api/main.go" -command="./bin/app" -directory="./"
I had tried adding -include=.env or -include=".env" or -include="\.env" but still to no avail. Is this a normal behaviour, which the .env file being exempted from the auto-reload? Or did I miss something?
Dockerfile:
I had tried adding
-include=.env
or-include=".env"
or-include="\.env"
but still to no avail. Is this a normal behaviour, which the .env file being exempted from the auto-reload? Or did I miss something?