Created
December 25, 2025 17:45
-
-
Save erikaheidi/e0d8a8edbe8e308966679974342ccbf4 to your computer and use it in GitHub Desktop.
A Docker Compose DEV setup for Laravel Reverb using a minimal container image from Chainguard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| app: | |
| image: singwithme-dev | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| restart: unless-stopped | |
| volumes: | |
| - .:/app | |
| - vendor:/app/vendor | |
| - node_modules:/app/node_modules | |
| ports: | |
| - "8000:8000" | |
| - "5173:5173" | |
| networks: | |
| - wolfi | |
| reverb: | |
| image: singwithme-dev | |
| restart: unless-stopped | |
| entrypoint: ["/bin/sh", "-c", "php artisan reverb:start"] | |
| volumes: | |
| - .:/app | |
| - vendor:/app/vendor | |
| - node_modules:/app/node_modules | |
| ports: | |
| - "8080:8080" | |
| networks: | |
| - wolfi | |
| networks: | |
| wolfi: | |
| driver: bridge | |
| volumes: | |
| vendor: | |
| node_modules: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM cgr.dev/chainguard/laravel:latest-dev | |
| USER root | |
| ARG user=laravel | |
| RUN apk add --no-cache npm nodejs php-pcntl | |
| RUN git config --global --add safe.directory /app && \ | |
| chown -R $user /home/$user /app | |
| WORKDIR /app | |
| # Copy application files into the container | |
| COPY --chown=$user:$user . . | |
| USER $user | |
| # Install PHP (composer) and Node dependencies | |
| RUN composer install --no-interaction --prefer-dist --optimize-autoloader | |
| RUN npm ci --prefer-offline --no-audit --progress=false | |
| # Expose common dev ports (Laravel/Vite) | |
| EXPOSE 8000 5173 | |
| # Make the container start the project's dev runner by default | |
| # Copy .env.example to .env if missing, generate key, run migrations, then start the dev server | |
| ENTRYPOINT ["/bin/sh", "-c", "if [ ! -f .env ]; then cp .env.example .env && php artisan key:generate; fi && php artisan migrate --force && composer run dev"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment