This image is based on the official php image for mor info click this link https://hub.docker.com/_/php
- Apache
- Composer
- PHP:7.4
- mlocati php-extension-installer (click for more details...)
# Set to production if you deploy
1. APP_ENV=null
# Location of your source code optional
2. WORKING_DIRECTORY=/usr/src/myapp
FROM raven1994/laravel-app:latest
# Copy source code to default app path
COPY . $WORKING_DIRECTORY
# write access to the storage and cache folders
RUN chgrp -R www-data $WORKING_DIRECTORY/storage $WORKING_DIRECTORY/bootstrap/cache
RUN chmod -R ug+rwx $WORKING_DIRECTORY/storage $WORKING_DIRECTORY/bootstrap/cache
# install packages
RUN composer install -n --no-dev
version: "3.8"
services:
app:
image: mywebapp
ports:
- 8000:80
volumes:
- ./:/usr/src/myapp
This image utilises mlocati/php-extension-installer . Install your extensions as shown below.
FROM raven1994/laravel-app:latest
# install extenstions
RUN install-php-extensions gmp zip
RUN composer install -n --no-dev
There are better options out there like Velocity , laradock, Homestead . I just love less in my environments