Created
September 2, 2023 02:00
-
-
Save wayanjimmy/5a4819b7ff882795b79236ea3970b9e4 to your computer and use it in GitHub Desktop.
Laravel Unit Docker Example
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
{ | |
"listeners": { | |
"*:8080": { | |
"pass": "routes" | |
} | |
}, | |
"routes": [ | |
{ | |
"match": { | |
"uri": "!/index.php" | |
}, | |
"action": { | |
"share": "/var/www/html/public$uri", | |
"fallback": { | |
"pass": "applications/laravel" | |
} | |
} | |
} | |
], | |
"applications": { | |
"laravel": { | |
"type": "php", | |
"root": "/var/www/html/public", | |
"script": "index.php" | |
} | |
} | |
} |
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 unit:1.31.0-php8.2 | |
EXPOSE 8080 | |
WORKDIR /var/www/html | |
COPY . . | |
COPY config.json /docker-entrypoint.d/config.json | |
COPY --from=composer /usr/bin/composer /usr/bin/composer | |
RUN composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev --no-cache | |
RUN mkdir -p storage/logs | |
RUN php artisan optimize:clear | |
RUN chown -R unit:unit /var/www/html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment