Skip to content

Instantly share code, notes, and snippets.

@wayanjimmy
Created September 2, 2023 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wayanjimmy/5a4819b7ff882795b79236ea3970b9e4 to your computer and use it in GitHub Desktop.
Save wayanjimmy/5a4819b7ff882795b79236ea3970b9e4 to your computer and use it in GitHub Desktop.
Laravel Unit Docker Example
{
"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"
}
}
}
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