Browse Source

Add a start script and automatically migrate the db

Pierre Jaury 7 years ago
parent
commit
b412616c28
3 changed files with 8 additions and 0 deletions
  1. 2 0
      docker/Dockerfile.apache
  2. 0 0
      docker/Dockerfile.fpm
  3. 6 0
      docker/start.sh

+ 2 - 0
Dockerfile.apache → docker/Dockerfile.apache

@@ -31,3 +31,5 @@ RUN install -d -m0755 -o www-data -g www-data \
 VOLUME ["/var/www/storage"]
 
 ENV PATH="~/.composer/vendor/bin:./vendor/bin:${PATH}"
+
+CMD /var/www/docker/start.sh

+ 0 - 0
Dockerfile → docker/Dockerfile.fpm


+ 6 - 0
docker/start.sh

@@ -0,0 +1,6 @@
+#!/bin/sh
+
+mkdir -p storage/framework/{cache,sessions,views,logs}
+php artisan migrate
+
+exec apache2-foreground