Run from Source (Docker) - aelassas/bookcars GitHub Wiki
-
Create
backend/.env.docker(Checkbackend/.env.docker.example) -
Create
admin/.env.docker(Checkadmin/.env.docker.example) -
Create
fontend/.env.docker(Checkfrontend/.env.docker.example) -
Start the development environment:
docker-compose -f docker-compose.dev.yml up -d -
Access the services:
- Frontend: http://localhost:8080
- Admin Panel: http://localhost:3001
- Backend Server: http://localhost:4002
- MongoDB Express: http://localhost:8084
An admin user is automatically created with the email provided in BC_ADMIN_EMAIL in backend/.env.docker and B00kC4r5 as password. You can change the password once you login to the admin panel.
Important:
For Docker-based development, Hot Module Replacement (HMR) needs explicit port and host configuration so the Vite dev server can communicate correctly between the container and the browser.
For admin/.env.docker, make sure to include these configs:
# for development inside docker
VITE_PORT=3001
VITE_HMR_HOST=localhost
VITE_HMR_PORT=3001
VITE_HMR_CLIENT_PORT=3001
For frontend/.env.docker, make sure to include these configs:
# for development inside docker
VITE_PORT=8080
VITE_HMR_HOST=localhost
VITE_HMR_PORT=8080
VITE_HMR_CLIENT_PORT=8080
These settings ensure that HMR works reliably for both the frontend and the admin dashboard when running inside Docker, enabling live reloads without requiring a full page refresh.