Public | Automated Build

Last pushed: 10 days ago
Short Description
Docker image to run Laravel 5.x projects
Full Description

laravel

Docker image to run PHP (supporting Laravel) and Node projects.

This image it's for development. Optimize to use in production!

In the latest update, I changed the base image to php:alpine for size optimizing.

Tags

  • latest:
    • php 7.1.8
      • composer 1.5.1
    • nodejs 8.3.0
      • npm 5.3.0
      • yarn 0.27.5

Supported Databases (PDO)

  • mssql (via dblib)
  • mysql
  • pgsql
  • sqlite

Extra supported extensions

  • curl
  • exif
  • gd
  • ldap
  • mongodb

Installing

docker pull hitalos/laravel

Using

With docker

docker run --name <container_name> -d -v $PWD:/var/www -p 80:80 hitalos/laravel

Where $PWD is the laravel installation folder.

With docker-compose

Create a docker-compose.yml file in the root folder of project using this as a template:

web:
    image: hitalos/laravel:latest
    ports:
        - 80:80
    volumes:
        - ./:/var/www
    # If you don't want to use default 'artisan serve' command, edit and uncomment the line below.
    # command: php -S 0.0.0.0:80 -t public public/index.php

Then run using this command:

docker-compose up

If you want to use a database, you can create your docker-compose.yml with two containers.

web:
    image: hitalos/laravel:latest
    ports:
        - 80:80
    volumes:
        - ./:/var/www
    links:
        - db
    environment:
        DB_HOST: db
        DB_DATABASE: dbname
        DB_USERNAME: username
        DB_PASSWORD: p455w0rd
        DB_CONNECTION: [pgsql or mysql]
db:
    image: [postgres or mysql]
    environment:
        # with mysql
        MYSQL_DATABASE: dbname
        MYSQL_USER: username
        MYSQL_PASSWORD: p455w0rd

        # with postgres
        POSTGRES_DB: dbname
        POSTGRES_USER: username
        POSTGRES_PASSWORD: p455w0rd
Docker Pull Command
Owner
hitalos
Source Repository

Comments (4)
jaredmalcolm
4 days ago

This works great, but... I did have to add a MYSQL_ROOT_PASSWORD: field to the docker-compose.yml file. I also changed db: -> image: -> mariadb. All other settings can remain the same and still use MariaDB.

deevus
6 months ago

Any chance you could add the php curl extension?

pakistanihaider
8 months ago

not sure why, but when i try to pull your image i get this error after some downloading
unauthorized: authentication required

ivanjobs
a year ago

thx for providing this image. BTW, how do I add a mysql container for it?