HMR with Docker
Unanswered
Oak shoot sawfly posted this in #help-forum
Oak shoot sawflyOP
I'm currently trying to get HMR to work with docker in my development environment and am having issues. My volumes are mapping correctly and I can see the code changes in my container but the app does not reload like it does before docker.
Here is my current setup:
im using nextjs 15
Here is my current setup:
import type { NextConfig } from 'next'
import type { Configuration as WebpackConfig } from 'webpack'
const nextConfig: NextConfig = {
webpack: (config: WebpackConfig) => {
// Add hot reloading support
config.watchOptions = {
poll: 1000,
aggregateTimeout: 300,
}
return config
}
}
export default nextConfig
version: '3.8'
services:
web:
build:
context: .
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
volumes:
- .:/app
- /app/node_modules
- /app/.next
environment:
- NODE_ENV=development
- WATCHPACK_POLLING=true
- CHOKIDAR_USEPOLLING=true
- NEXT_WEBPACK_USEPOLLING=1
- NEXT_HAS_DOCKER_SUPPORT=1
- MONGODB_URI=mongodb://mongodb:27017/your_database
depends_on:
- mongodb
stdin_open: true
tty: true
mongodb:
image: mongo:latest
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
environment:
- MONGO_INITDB_DATABASE=your_database
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=example
mongo-express:
image: mongo-express
ports:
- "8081:8081"
environment:
- ME_CONFIG_MONGODB_ADMINUSERNAME=root
- ME_CONFIG_MONGODB_ADMINPASSWORD=example
- ME_CONFIG_MONGODB_URL=mongodb://root:example@mongodb:27017/
depends_on:
- mongodb
volumes:
mongodb_data:
im using nextjs 15
1 Reply
Barbary Lion
same issue for me!!