Created
October 1, 2021 14:48
-
-
Save Adizbek/a8e265008f49313602a5415109be462d to your computer and use it in GitHub Desktop.
General purpose Dockerfile for laravel project
This file contains 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 phpswoole/swoole:4.7-php8.0-alpine | |
# Working directory was set to /var/www | |
ENV APP_ENV production | |
RUN apk add --no-cache zip unzip git libxml2-dev oniguruma-dev libpng-dev icu-dev autoconf g++ make nodejs npm yarn && \ | |
pecl install redis && docker-php-ext-enable redis | |
# Install PHP extensions | |
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd opcache intl | |
COPY composer.* ./ | |
RUN composer install --no-dev --no-cache --no-scripts | |
COPY yarn.lock package.json ./ | |
RUN yarn && yarn cache clean --all | |
COPY . . | |
# install roadrunner | |
RUN composer du && yarn prod | |
CMD php artisan octane:start --host=0.0.0.0 --server=swoole | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment