Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go does not rebuild when .env file is changed #86

Open
xiaoming857 opened this issue Feb 13, 2023 · 0 comments
Open

Go does not rebuild when .env file is changed #86

xiaoming857 opened this issue Feb 13, 2023 · 0 comments

Comments

@xiaoming857
Copy link

Dockerfile:

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant