0

Im trying to setup podman as a drop-in replacement for docker and docker compose. The 'build' and 'run' commands all work; however, the hot-reloading does not seem to work on podman while it works fine on docker.

dockerfile

FROM node:22-alpine as base

WORKDIR /app

COPY package.lock.json
COPY package.json
RUN npm install

COPY . .
EXPOSE 3000
CMD ["npm", "run", "dev", "--host", "0.0.0.0", "--port", "3000"]

compose file

services
  web:
    build:
    dockerfile: dockerfile
    volumes:
      - .:app
      - node_modules:/app/node_modules
    ports: 3000:3000

As mentioned, running docker compose up builds and runs the web app fine with hot-reloading. However, running podman compose up will just build and run but without hot-reloading.

What else could I try? Are there any issues here?

2
  • You can use Node directly here, especially since your setup doesn't seem to be using anything in the container at all. Installing Node is very straightforward and it's usually a single command through your OS package manager. You don't need either Docker or Podman for day-to-day Javascript development. Commented May 25 at 10:45
  • @DavidMaze Of course, but I need it to run it in a container both for local development and other environments. Commented May 26 at 9:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.