How can I get hot reloading work in docker? 🤗
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 94
- Forks
- 21
- Avg merge
- 4m
- Merged PRs (30d)
- 2
Description
Question description
I'm having trouble getting the hot reloading working with fiber dev inside a docker container.
Here is my Dockerfile.
FROM golang:1.18-alpine as build
WORKDIR /go/src/api
RUN go install github.com/gofiber/cli/fiber@latest
COPY . .
RUN go mod download
CMD ["fiber", "dev"]
Here is my docker-compose file.
services:
db:
image: mongo:5.0.7
restart: always
ports:
- 27017:27017
volumes:
- mongodb:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: ${DB_USERNAME:-root}
MONGO_INITDB_ROOT_PASSWORD: ${DB_PASSWORD:-password}
api:
depends_on:
- db
build:
context: ./api
target: build
restart: always
ports:
- 3000:3000
volumes:
- ./api:/app
volumes:
mongodb:
I do see the files being changed inside the container but I cannot get the fiber cli to restart the fiber. What I might be missing?
Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Dockerfile and docker-compose configuration shown in the issue, then reproduce the behavior with fiber dev while changing a mounted file. Check how the CLI observes changes inside the container and compare that with the reported file visibility. Done means identifying a verified cause and a reproducible container configuration or limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, go
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100