Giter VIP home page Giter VIP logo

docker-laravel's Introduction

Docker Images for Laravel development

Docker Build Status Docker Build Status Docker Build Status

This repository provides you a development environment without requiring you to install PHP, a web server, and any other server software on your local machine. For this, it requires Docker and Docker Compose.

Installation

  1. Install docker and docker-compose ;

  2. Copy docker-compose.yml file to your project root path, and edit it according to your needs ;

  3. From your project directory, start up your application by running:

docker-compose up
  1. If you want, you can run composer or artisan through docker. For instance:
docker-compose exec php composer install
docker-compose exec php php artisan migrate
docker-compose exec php $yourCommandHere

Docker Images

These docker images are configured in docker-compose.yml file. You can comment or uncomment some services according to your project.

  • jguyomard/laravel-php:7.3 (this docker image extends php:7.3-fpm-alpine to add some PHP extensions) ;
  • jguyomard/laravel-nginx:1.13 (this docker image extends nginx:1.13-alpine to add Laravel vhost) ;
  • mysql:5.7 ;
  • postgres:9.6-alpine ;
  • redis:4.0-alpine ;
  • elasticsearch:5.5-alpine.

Other tools

This repository also comes with a caspistrano docker image: jguyomard/laravel-capistrano:3.9.

For ease of use, you can create a bash alias:

alias cap='docker run --rm --user cap -v "$PWD":/src -v "$(dirname $SSH_AUTH_SOCK)":"$(dirname $SSH_AUTH_SOCK)" -e SSH_AUTH_SOCK="${SSH_AUTH_SOCK}" jguyomard/laravel-capistrano:3.9 cap'

Contributing

Contributions are welcome! Leave an issue on Github, or create a Pull Request.

Licence

This work is under MIT licence.

docker-laravel's People

Contributors

jguyomard avatar karllhughes avatar mauriciv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-laravel's Issues

Nginx : 413 Request Entity Too Large

Hi,

I've got an error (413 Request Entity Too Large) when i try to upload a file from my application (3mo).
I think you can fix it with this configuration :

server {
....
       client_max_body_size 20M;
....
   }

Not a windows path

Within the php Dockerfile the composer installation is called and then later mounted to $HOME/.composer in the docker-compose.yml. This is not a windows path and therefore, the container won't start up... I'm fairly new to docker, do you have any solutions? Thanks in advance!

PHPUnit/XDebug support

I use this image as a base image for many projects, but it doesn't include PHPUnit or XDebug.

I don't think the core image should, but what do you think about adding another folder for a development version of the image? Right now I'm just extending this image like this:

FROM jguyomard/laravel-php:7.2

RUN curl https://phar.phpunit.de/phpunit-7.0.phar -L -o phpunit.phar && \
    chmod +x phpunit.phar && mv phpunit.phar /usr/local/bin/phpunit && \
    apk add --no-cache $PHPIZE_DEPS && \
    pecl install xdebug-2.6.1 && \
    docker-php-ext-enable xdebug

CMD phpunit

Just a thought. I don't mind maintaining my own image, just figured others might want PHPUnit and XDebug as well.

Dockerfile for nginx not needed

The dockerfile for nginx is not needed.

Here is a full example how to use nginx without an own "Dockerfile for nginx":

version: '3'
services:

  # Application
  app:
    build:
      context: .
      dockerfile: ./.docker/app/app.dockerfile
    volumes:
      - codevolume:/var/www

  # Web server
  web:
    image: nginx
    volumes:
      - ./.docker/web/vhost.conf:/etc/nginx/conf.d/default.conf
      - codevolume:/var/www
    depends_on:
      - app
    ports:
      - 8080:80
      - 8443:443

volumes:
  codevolume:

(This is just an example.)

PHP gd extension

Hi,

I'm trying to use an laravel app, but it uses the gd extension.

Is there any way to install it?

Regards.

Upgrading to PHP 7.3

I've got to upgrade my images to PHP 7.3 at work. If you're interested, I can make a PR here to add my changes? If not, I'm happy to live in my own fork for now.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.