Run from Source (Docker) - aelassas/bookcars GitHub Wiki

  1. Create backend/.env.docker (Check backend/.env.docker.example)

  2. Create admin/.env.docker (Check admin/.env.docker.example)

  3. Create fontend/.env.docker (Check frontend/.env.docker.example)

  4. Start the development environment:

    docker-compose -f docker-compose.dev.yml up -d
    
  5. Access the services:

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.