Giter Site home page Giter Site logo

Comments (5)

MohabMohamed avatar MohabMohamed commented on June 25, 2024 1

@hcancelik I think the problem is you are mounting the wrong directory inside the container. you are mounting /app in the docker-compose file and putting your code in /go/src/api.

so try to change the docker file line WORKDIR /go/src/api to WORKDIR /app or change in your docker-compose.yml the part

    volumes:
      - ./api:/app

to

    volumes:
      - ./api:/go/src/api

both solutions should work, if it still not working please tell me.

from cli.

welcome avatar welcome commented on June 25, 2024

Thanks for opening your first issue here! πŸŽ‰ Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

from cli.

hcancelik avatar hcancelik commented on June 25, 2024

Thanks for the reply @MohabMohamed.

They are indeed wrong, so I've corrected them. However, the hot reload is still not working.

from cli.

TheTeaCat avatar TheTeaCat commented on June 25, 2024

I've had this issue today with an Ubuntu 22.04 machine, while the hot reloading works fine on a mac.

I'm pretty certain what this comes down to is the fact that file system events on the Ubuntu host machine don't get propagated into the container - if we go inside the container and modify the files from within then the hot reloading works, but if we modify it from the host machine it doesn't.

If the host machine is MacOS then changes on the host machine do trigger the hot reload as osxfs supports creation, modification, attribute change, deletion and directory change events. See the docs here.

This is an issue for non-mac users wanting to containerise their development environments face with various different development tools that provide hot reloading, and the typical solution is to provide a legacy watch option which periodically checks for changes instead of relying upon file system events. This CLI tool doesn't have one, though. Feature request maybe?

In the meantime I'm going to experiment with using air instead, which has been suggested in this comment in an issue on the gofiber/fiber repo regarding hot reload support.

from cli.

TheTeaCat avatar TheTeaCat commented on June 25, 2024

Update: air also doesn't have a legacy watch option, so neither air or the fiber cli work in my use case.

from cli.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.