Running into long compile times using docker desktop, roughly 30 seconds.
Running the project locally is fast, roughly 2-3 seconds.
Anyone else run into this issue?
WSL2 config:
[wsl2]
memory=4000MB #Limits VM memory in WSL 2 to 4000MB
processors=4 #Makes the WSL 2 VM use four virtual processors
Docker Compose File:
version: "3.4"
name: "node-app"
services:
# Node api service
api:
build:
context: .
dockerfile: ./Dockerfile
command: npm run dev
environment:
NODE_ENV: development
ports:
- 8800:8800
depends_on:
- mongodb
- redis
volumes:
- .:/usr/src/app
# Mongodb service
mongodb:
container_name: node-app-mongodb
image: mongo:latest
restart: always
volumes:
- mongo_data:/data/db
command: mongod --quiet --logpath /dev/null
# Redis service
redis:
container_name: node-app-redis
image: redis:latest
restart: always
ports:
- "6379:6379"
volumes:
- redis_data:/data
volumes:
mongo_data: {}
redis_data: {}