Skip to content

Commit

Permalink
chore: Imported changes from private project.
Browse files Browse the repository at this point in the history
issue #1
  • Loading branch information
sandrodz committed Oct 1, 2017
1 parent ee5b83f commit d7f7f3d
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 38 deletions.
24 changes: 4 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# a list of version numbers.
FROM phusion/baseimage:0.9.19

ENV TZ=Asia/Tbilisi

# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]

Expand All @@ -15,31 +13,17 @@ RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y \
mariadb-server mariadb-client \
nginx \
nodejs npm \
php7.0-cli php7.0-fpm php7.0-gd php7.0-mcrypt php7.0-mbstring php7.0-mysql php7.0-curl \
redis-server
php7.0-cli php7.0-fpm php7.0-gd php7.0-mcrypt php7.0-mbstring php7.0-xml php7.0-zip php7.0-mysql php7.0-curl \
redis-server \
git

# This is a fix for
# ERROR: unable to bind listening socket for address '/run/php/php7.0-fpm.sock': No such file or directory (2)
# ERROR: FPM initialization failed
RUN service php7.0-fpm start

#
ADD configs/nginx/default /etc/nginx/sites-available/default

RUN mkdir /etc/service/nginx
ADD runit/nginx.sh /etc/service/nginx/run

RUN mkdir /etc/service/php-fpm
ADD runit/php-fpm.sh /etc/service/php-fpm/run

RUN mkdir /etc/service/redis-server
ADD runit/redis-server.sh /etc/service/redis-server/run

RUN mkdir /etc/service/mariadb
ADD runit/mariadb.sh /etc/service/mariadb/run

RUN mkdir /etc/service/queue
ADD runit/queue.sh /etc/service/queue/run
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

#
RUN mkdir -p /etc/my_init.d
Expand Down
32 changes: 15 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Larawell uses [phusion/baseimage](https://github.com/phusion/baseimage-docker#wa
+ npm
+ schedule:run
+ queue:work
+ composer

Both schedule:run (cron) and queue:work (service) are included and running properly by default. There is no other docker container for Laravel that offers working cron or queue, so if you plan to run full featured Laravel app this should be your container of choice.

Expand All @@ -24,31 +25,28 @@ Note: Larawell uses `queue:work --daemon` instead of `queue:listen` as later was

Container is bundled with 7 helper bash scripts. Few of them are required for correct functioning and some can be enabled on user discretion.

+ 01_mariadb_initialize.sh -
+ 02_mariadb_secure.sh -
+ 03_mariadb_prepare_database.sh -
+ 04_laravel_install.sh -
+ 05_laravel_migrate.sh -
+ 06_laravel_seed.sh -
+ 07_mariadb_import_dump.sh -
+ 01_mariadb_initialize.sh -
+ 02_mariadb_secure.sh -
+ 03_mariadb_prepare_database.sh -
+ 04_laravel_install.sh -
+ 05_laravel_migrate.sh -
+ 06_laravel_seed.sh -
+ 07_mariadb_import_dump.sh -

#### Usage

larawell includes docker-compose.yml

```yml
larawell:
build: ./
restart: always
ports:
- "80:80"
volumes:
- ./app:/var/www
#- ./mysql:/var/lib/mysql
environment:
MARIA_ROOT_PASSWORD: secret

```

As project develops, the plan is to consolidate all the options in this file.

#### Quick start

To build, run and daemonize you can `docker-compose up -d --build`

#### pArtisan

To run artisan commands from host you can use `partisan` tool inside larawell root
3 changes: 3 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#1 Laravel should log to syslog so that docker can display laravel errors
#2 cleanup shell scripts
#3 finish partisan
Empty file added app/.gitkeep
Empty file.
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@ larawell:
volumes:
- ./app:/var/www
#- ./mysql:/var/lib/mysql
- ./configs/nginx/default:/etc/nginx/sites-available/default
- ./runit/nginx.sh:/etc/service/nginx/run
- ./runit/php-fpm.sh:/etc/service/php-fpm/run
#- ./runit/redis-server.sh:/etc/service/redis-server/run
- ./runit/mariadb.sh:/etc/service/mariadb/run
#- ./runit/queue.sh:/etc/service/queue/run
environment:
MARIA_ROOT_PASSWORD: secret
MARIA_ROOT_PASSWORD: secret
TZ: Asia/Tbilisi
Empty file added export.sql
Empty file.
1 change: 1 addition & 0 deletions partisan
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker exec -it $(docker-compose ps -q) bash -c "/usr/bin/php /var/www/artisan $@"

0 comments on commit d7f7f3d

Please sign in to comment.