GithubHelp home page GithubHelp logo

th3architect / alpine-nginx-php-mariadb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dydx/alpine-nginx-php-mariadb

0.0 2.0 0.0 12 KB

multi-container docker based setup for working with PHP apps, based off of Alpine Linux

alpine-nginx-php-mariadb's Introduction

alpine-nginx-php-mariadb

A slightly opinionated minimal development environment for PHP/Laravel, built with:

  • Alpine Linux
  • Nginx 1.8.0
  • PHP 5.6
  • MariaDB 5.5

Usage

  • clone this repo: git clone https://github.com/dydx/alpine-nginx-php-mariadb
  • cd in: cd alpine-nginx-php-mariadb
  • build/run it: docker-compose up -d

Connections

MariaDB is linked as mysql, just reference this in your database connection config. The credentials are identical to Laravel Homestead's:

  • database: homestead
  • username: homestead
  • password: secret

Running Artisan migrations and seeds

I'm still working on a more efficient way to do this, but currently, you have to do this to run artisan:

  • attach to the nginx container: docker exec -it alpinenginxphpmariadb_front_1 /bin/sh
  • cd to the web root: cd /var/www/default
  • run your migrations/seeds: php artisan migrate or php artisan db:seed

Data locations and persistence

MySQL is persisted to the host in the database directory, Nginx's default vhost is stored at sites/default, and your http docs are stored in www/default.

The setup is a little opinionated for Laravel development; the current Nginx vhost has /var/www/default/public as its doc root. You can obviously change this for your needs.

size

I wanted these containers to be pretty small, considering that my main workstation is an Acer C720 with the 16Gb SSD (running Elementary OS). On my machine, here are the image virtual sizes:

  • front: 70.05 MB
  • mysql: 199.5 MB

I think this is considerably smaller than the setup I had with kasperisager's excellent phpstack. There isn't anything inherently wrong with his setup (it actually has a lot more features baked in), but it was cramping my laptop up quite a bit.

TODO

I'm considering adding in Composer, PHPUnit, NodeJS/Gulp/Bower for doing all of the development related tasks in the nginx container, but I'm unsure just how necessary that is.

alpine-nginx-php-mariadb's People

Contributors

dydx avatar

Watchers

 avatar  avatar

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.