#!/bin/bash

mkdir -p /run/php
chown -R nginx:nginx /run/php
chown -R nginx:nginx /var/www
chmod -R 775 /var/www/notification/public
chmod -R 775 /var/www/notification/storage
chmod -R 775 /var/www/notification/bootstrap/cache

# Tweak nginx to match the workers to cpu's
# procs=$(cat /proc/cpuinfo |grep processor | wc -l)
# sed -i -e "s/worker_processes auto/worker_processes $procs/" /etc/nginx/nginx.conf

# Start supervisord and services
/usr/bin/supervisord -n -c /etc/supervisord.conf
