Build and start all Docker containers:
docker compose up -d --buildTo set or update the Nginx HTTP basic auth password:
docker run --rm httpd:alpine htpasswd -nbB <username> <password> > ./docker/nginx/.htpasswdReplace
<username>and<password>with your desired credentials.
After updating the password, restart the Nginx container:
docker compose restart nginxAfter building the project, enter the app container for initial setup:
docker compose exec app bashInside the container, you can run regular Laravel commands, for example:
php artisan migrate
php artisan db:seed
php artisan config:cacheExit the container anytime by typing:
exitIf you see a permission error when running Docker commands, add your user to the docker group:
sudo usermod -aG docker $USER
newgrp dockerThen try again:
docker compose up -d --build- Use
docker compose(v2 syntax) instead ofdocker-compose(deprecated). - Always restart Nginx after changing the
.htpasswdfile. - Commands inside the container should be run as needed for Laravel setup.