Skip to content

Instantly share code, notes, and snippets.

@Adizbek
Created October 1, 2021 14:48
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 Adizbek/a8e265008f49313602a5415109be462d to your computer and use it in GitHub Desktop.
Save Adizbek/a8e265008f49313602a5415109be462d to your computer and use it in GitHub Desktop.
General purpose Dockerfile for laravel project
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