Skip to content

Commit

Permalink
Add Docker Support
Browse files Browse the repository at this point in the history
  • Loading branch information
solidnerd committed Jul 13, 2015
1 parent 970afc4 commit 5f8d063
Show file tree
Hide file tree
Showing 5 changed files with 664 additions and 0 deletions.
41 changes: 41 additions & 0 deletions Docker/ProxyNginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
upstream dash-handler {
server 127.0.0.1:9002;
}

server {
listen 80;
server_name dash.example.com;
root /var/www/public;

# Point index to the Laravel front controller.
index index.php;

location / {
# URLs to attempt, including pretty ones.
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php(?:$|/) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass dash-handler;
}

# Remove trailing slash to please routing system.
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}

# We don't need .ht files with nginx.
location ~ /\.ht {
deny all;
}

# Set header expirations on per-project basis
location ~* \.(?:ico|css|js|jpe?g|JPG|png|svg|woff)$ {
expires 365d;
}

}
26 changes: 26 additions & 0 deletions Docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

cat > .env <<-EOF
APP_KEY=${APP_KEY:-SomeRandomKey!}
APP_ENV=${APP_ENV:-local}
APP_DEBUG=${APP_ENV:-true}
APP_LOCALE=${APP_LOCALE:-en}
APP_FALLBACK_LOCALE=${APP_FALLBACK_LOCALE:-en}
DB_CONNECTION=${DB_CONNECTION:-mysql}
DB_HOST=${DB_PORT_3306_TCP_ADDR:-localhost}
DB_DATABASE=${DB_DATABASE:-annotations}
DB_USERNAME=${DB_USER:-mysql_username}
DB_PASSWORD=${DB_PASSWORD:-mysql_password}
CACHE_DRIVER=${CACHE_DRIVER:-file}
SESSION_DRIVER=${SESSION_DRIVER:-file}
QUEUE_DRIVER=${QUEUE_DRIVER:-sync}
EOF
composer config -g github-oauth.github.com ${TOKEN:-}
composer install
php artisan cache:clear
chmod -R 777 public
chmod -R 777 storage
php artisan migrate --force
exec php-fpm
Loading

0 comments on commit 5f8d063

Please sign in to comment.