Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Commit

Permalink
initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
abude committed Mar 23, 2020
0 parents commit 2ced824
Show file tree
Hide file tree
Showing 336 changed files with 63,324 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.DS_Store
.idea
error_log
__MACOSX
.ssh
.composer
.bash_profile
.bash_history
logs
web/vendor
web/config/db.php
web/composer.lock
40 changes: 40 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Prerequisites

Please answer the following questions for yourself before submitting an issue.

- [ ] I am running the latest version
- [ ] I checked the documentation and found no answer
- [ ] I checked to make sure that this issue has not already been filed
- [ ] I'm reporting the issue to the correct repository (for multi-repository projects)

# Expected Behavior

Please describe the behavior you are expecting

# Current Behavior

What is the current behavior?

# Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

## Steps to Reproduce

Please provide detailed steps for reproducing the issue.

1. step 1
2. step 2
3. you get it...

## Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

* Device:
* Operating System:
* Browser and Version:

## Failure Logs

Please include any relevant log snippets or files here.
438 changes: 438 additions & 0 deletions README.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

All notable changes to `Material Dashboard` frontend preset for Yii2 will be documented in this file.

## Version 1.0.0
- Initial Release
54 changes: 54 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# @package Material Dashboard Yii2
# @author CodersEden <hello@coderseden.com>
# @link https://www.coderseden.com
# @copyright 2020 Material Dashboard Yii2 (https://www.coderseden.com)
# @license MIT - https://www.coderseden.com
# @since 1.0
material-dashboard-mysql:
image: mysql:5.7
container_name: material-dashboard-mysql
environment:
- MYSQL_ROOT_PASSWORD=material-dashboard
- MYSQL_DATABASE=material-dashboard
- MYSQL_USER=material-dashboard
- MYSQL_PASSWORD=material-dashboard
- MYSQL_PORT=3306
- MYSQL_HOST=localhost

material-dashboard-webserver:
image: phpdockerio/nginx:latest
container_name: material-dashboard-webserver
volumes:
- ../web:/var/www/material-dashboard/web
- ./ssl:/etc/nginx/ssl
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "80:80"
- "443:443"
links:
- material-dashboard-php-fpm

material-dashboard-php-fpm:
build: .
dockerfile: php-fpm/Dockerfile
container_name: material-dashboard-php-fpm
volumes:
- ../web:/var/www/material-dashboard/web
- ./php-fpm/php-ini-overrides.ini:/etc/php/7.2/fpm/conf.d/99-overrides.ini
links:
- material-dashboard-mysql
environment:
YII_ENV_DOCKER: 1

material-dashboard-phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: material-dashboard-phpmyadmin
environment:
- PMA_ARBITRARY=1
- PMA_HOST=material-dashboard-mysql
restart: always
ports:
- 81:80
links:
- material-dashboard-mysql
Empty file added docker/mysql/db.sql
Empty file.
105 changes: 105 additions & 0 deletions docker/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#
# @package Material Dashboard Yii2
# @author CodersEden <hello@coderseden.com>
# @link https://www.coderseden.com
# @copyright 2020 Material Dashboard Yii2 (https://www.coderseden.com)
# @license MIT - https://www.coderseden.com
# @since 1.0
FROM phpdockerio/nginx:latest

RUN echo '@testing http://nl.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \
echo '@community http://nl.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories && \
echo '@main http://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories && \

# Install specific packages
apk add --update \
git \
bash \
nano \
grep \
sed \
curl \
wget \
tar \
gzip \
pcre \
perl \
openssh \
patch \
patchutils \
diffutils \
docker \
mariadb-client \
imap \
imagemagick@main \
libwebp@main \
libressl@main \
&& \

# Install PHP packages
apk add --update \
php7@community \
php7-opcache@community \
php7-session@community \
php7-xml@community \
php7-ctype@community \
php7-ftp@community \
php7-gd@community \
php7-json@community \
php7-posix@community \
php7-curl@community \
php7-dom@community \
php7-pdo@community \
php7-pdo_mysql@community \
php7-sockets@community \
php7-zlib@community \
php7-mcrypt@community \
php7-mysqli@community \
php7-sqlite3@community \
php7-bz2@community \
php7-phar@community \
php7-openssl@community \
php7-posix@community \
php7-zip@community \
php7-calendar@community \
php7-iconv@community \
php7-imap@community \
php7-soap@community \
php7-dev@community \
php7-pear@community \
php7-mbstring@community \
php7-exif@community \
php7-xsl@community \
php7-ldap@community \
php7-bcmath@community \
&& \

# Create symlinks PHP -> PHP7
ln -sf /usr/bin/php7 /usr/bin/php && \

# Configure php.ini
sed -i \
-e "s/^expose_php.*/expose_php = Off/" \
-e "s/^;date.timezone.*/date.timezone = UTC/" \
-e "s/^memory_limit.*/memory_limit = -1/" \
-e "s/^max_execution_time.*/max_execution_time = 300/" \
-e "s/^post_max_size.*/post_max_size = 512M/" \
-e "s/^upload_max_filesize.*/upload_max_filesize = 512M/" \
-e "s@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i -S opensmtpd:25@" \
/etc/php7/php.ini && \

echo "error_log = \"/var/log/php/error.log\"" | tee -a /etc/php7/php.ini && \

# Configure php log dir
rm -rf /var/log/php7 && \
mkdir /var/log/php && \
touch /var/log/php/error.log && \

# Install composer
#curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \

# Purge dev APK packages
apk del --purge *-dev build-base autoconf libtool && \

# Final cleanup
rm -rf /var/cache/apk/* /tmp/* /usr/share/man
55 changes: 55 additions & 0 deletions docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
server {
listen 80;
server_name material-dashboard.test;
return 301 https://$server_name$request_uri;
}
#
# @package Material Dashboard Yii2
# @author CodersEden <hello@coderseden.com>
# @link https://www.coderseden.com
# @copyright 2020 Material Dashboard Yii2 (https://www.coderseden.com)
# @license MIT - https://www.coderseden.com
# @since 1.0
server {
listen 443 ssl;

ssl on;
ssl_certificate /etc/nginx/ssl/material-dashboard.crt;
ssl_certificate_key /etc/nginx/ssl/material-dashboard.key;

# max upload
client_max_body_size 108M;

# keep utf-8
charset UTF-8;

# http://serverfault.com/questions/269420/disable-caching-when-serving-static-files-with-nginx-for-development
sendfile off;

access_log /var/log/nginx/material-dashboard.access.log;

root /var/www/material-dashboard/web/web;
index index.php;


location / {
if (!-e $request_filename){
rewrite ^(/)?admin/.*$ /admin/index.php;
}
if (!-e $request_filename){
rewrite ^(.*)$ /index.php;
}
index index.html index.htm index.php;
}

location ~ \.php$ {
fastcgi_pass material-dashboard-php-fpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_VALUE "error_log=/var/log/nginx/yii2_php_errors.log";
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_intercept_errors on;
include fastcgi_params;
}
}
15 changes: 15 additions & 0 deletions docker/php-fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# @package Material Dashboard Yii2
# @author CodersEden <hello@coderseden.com>
# @link https://www.coderseden.com
# @copyright 2020 Material Dashboard Yii2 (https://www.coderseden.com)
# @license MIT - https://www.coderseden.com
# @since 1.0
FROM phpdockerio/php72-fpm:latest

# Install selected extensions and other stuff
RUN apt-get update \
&& apt-get -y --no-install-recommends install php7.2-mysql php-redis php7.2-bcmath php7.2-gd php7.2-imap php7.2-intl php7.2-ldap php7.2-mbstring php7.2-soap php7.2-tidy \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

WORKDIR "/var/www/material-dashboard/web"
13 changes: 13 additions & 0 deletions docker/php-fpm/php-ini-overrides.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# @package Material Dashboard Yii2
# @author CodersEden <hello@coderseden.com>
# @link https://www.coderseden.com
# @copyright 2020 Material Dashboard Yii2 (https://www.coderseden.com)
# @license MIT - https://www.coderseden.com
# @since 1.0
upload_max_filesize = 100M
memory_limit = 256M
proxy_read_timeout = 3600
post_max_size = 108M
max_input_vars = 3000
max_execution_time = 300
45 changes: 45 additions & 0 deletions docker/scripts/docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash
#
# @package Material Dashboard Yii2
# @author CodersEden <hello@coderseden.com>
# @link https://www.coderseden.com
# @copyright 2020 Material Dashboard Yii2 (https://www.coderseden.com)
# @license MIT - https://www.coderseden.com
# @since 1.0

# default values for command line variables
ACTION=""

# arguments init
for i in "$@"
do
case $i in
up)
ACTION="up"
shift # past argument=value
;;
down)
ACTION="down"
shift # past argument=value
;;
remove)
ACTION="remove"
shift # past argument=value
;;
*)
# unknown option
;;
esac
done

if [[ "$ACTION" = "up" ]]; then
docker-compose up --build
fi

if [[ "$ACTION" = "down" ]]; then
docker kill $(docker ps -q)
fi

if [[ "$ACTION" = "remove" ]]; then
docker rm -f $(docker ps -q -a)
fi
27 changes: 27 additions & 0 deletions docker/ssl/material-dashboard.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN CERTIFICATE-----
MIIEkDCCAvigAwIBAgIQSeSCKswCizkglrNSYLOgaTANBgkqhkiG9w0BAQsFADCB
izEeMBwGA1UEChMVbWtjZXJ0IGRldmVsb3BtZW50IENBMTAwLgYDVQQLDCdBYnVk
ZUBNYWNCb29rLVByby5sb2NhbCAoQWJ1ZGUgQmF5YXNzaSkxNzA1BgNVBAMMLm1r
Y2VydCBBYnVkZUBNYWNCb29rLVByby5sb2NhbCAoQWJ1ZGUgQmF5YXNzaSkwHhcN
MTkwNjAxMDAwMDAwWhcNMzAwMjE2MjE1OTM0WjBhMScwJQYDVQQKEx5ta2NlcnQg
ZGV2ZWxvcG1lbnQgY2VydGlmaWNhdGUxNjA0BgNVBAsMLUFidWRl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