-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #271 from handhikadj/dev_for_new_features
propose better docker setup
- Loading branch information
Showing
521 changed files
with
650 additions
and
140 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified
0
database/migrations/2014_10_12_000000_create_schools_table.php
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified
0
database/migrations/2017_12_27_025313_create_password_resets_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2017_12_27_025349_create_attendances_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2017_12_27_025413_create_classes_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2017_12_27_025427_create_sections_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2017_12_27_025450_create_syllabuses_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2017_12_27_025503_create_notices_table.php
100644 → 100755
Empty file.
Empty file.
Empty file modified
0
database/migrations/2017_12_27_025530_create_homeworks_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2017_12_27_025542_create_routines_table.php
100644 → 100755
Empty file.
Empty file.
Empty file modified
0
database/migrations/2017_12_27_025612_create_notifications_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2017_12_27_025631_create_feedbacks_table.php
100644 → 100755
Empty file.
Empty file.
Empty file modified
0
database/migrations/2017_12_27_025727_create_courses_table.php
100644 → 100755
Empty file.
Empty file.
Empty file modified
0
database/migrations/2017_12_27_025751_create_messages_table.php
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified
0
database/migrations/2018_03_26_105657_create_grade_systems_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2018_03_27_153448_create_issued_books_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2018_04_01_195635_create_accounts_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2018_04_01_195715_create_account_sectors_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2018_04_29_121233_create_student_infos_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2018_04_29_121517_create_student_board_exams_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2018_10_05_163435_create_exam_for_classes_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2018_10_08_002853_add_department_class_teacher_to_users_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2018_10_09_093606_add_term_start_end_date_to_exams_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2018_10_09_203125_create_departments_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2019_04_08_105033_add_class_id_to_syllabuses_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2019_04_08_121149_add_section_id_to_routines_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2019_04_25_101700_add_active_to_exam_for_class_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2019_05_10_151601_add_stripe_fields_in_users_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2019_05_10_163920_create_stripe_subscription_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2019_05_10_193135_create_payments_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2020_07_24_201246_create_certificates_table.php
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,109 @@ | ||
version: '3' | ||
|
||
#Docker Networks | ||
networks: | ||
app-network: | ||
driver: bridge | ||
|
||
#Volumes | ||
volumes: | ||
dbdata: | ||
driver: local | ||
|
||
services: | ||
|
||
#PHP Service | ||
app: | ||
#Nginx Service | ||
nginx: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
image: digitalocean.com/php | ||
container_name: app | ||
restart: unless-stopped | ||
tty: true | ||
environment: | ||
SERVICE_NAME: app | ||
SERVICE_TAGS: dev | ||
working_dir: /var/www | ||
volumes: | ||
- ./:/var/www | ||
- ./php/local.ini:/usr/local/etc/php/conf.d/local.ini | ||
networks: | ||
- app-network | ||
|
||
#Nginx Service | ||
webserver: | ||
image: nginx:alpine | ||
container_name: webserver | ||
restart: unless-stopped | ||
tty: true | ||
dockerfile: ./docker/nginx.dockerfile | ||
container_name: nginx | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
- "${DOCKER_WEBSERVER_HOST}:80" | ||
volumes: | ||
- ./:/var/www | ||
- ./nginx/conf.d/:/etc/nginx/conf.d/ | ||
- .:/var/www/html | ||
depends_on: | ||
- php | ||
- db | ||
networks: | ||
- app-network | ||
|
||
#MySQL Service | ||
db: | ||
image: mysql:5.7.22 | ||
image: mysql:latest | ||
container_name: db | ||
restart: unless-stopped | ||
tty: true | ||
ports: | ||
- "3306:3306" | ||
environment: | ||
MYSQL_DATABASE: school | ||
MYSQL_ROOT_PASSWORD: x12345678y | ||
MYSQL_USER: root | ||
MYSQL_PASSWORD: x12345678y | ||
MYSQL_DATABASE: ${DB_DATABASE} | ||
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD} | ||
MYSQL_USER: ${DB_USERNAME} | ||
MYSQL_PASSWORD: ${DB_PASSWORD} | ||
SERVICE_TAGS: dev | ||
SERVICE_NAME: mysql | ||
volumes: | ||
- dbdata:/var/lib/mysql/ | ||
- ./mysql/my.cnf:/etc/mysql/my.cnf | ||
- dbdata:/var/lib/mysql | ||
networks: | ||
- app-network | ||
|
||
#Docker Networks | ||
networks: | ||
app-network: | ||
driver: bridge | ||
#Volumes | ||
volumes: | ||
dbdata: | ||
driver: local | ||
#PHP Service | ||
php: | ||
build: | ||
context: . | ||
dockerfile: ./docker/php.dockerfile | ||
container_name: php | ||
volumes: | ||
- .:/var/www/html | ||
ports: | ||
- "9000:9000" | ||
networks: | ||
- app-network | ||
|
||
#Composer Service | ||
composer: | ||
build: | ||
context: . | ||
dockerfile: ./docker/composer.dockerfile | ||
container_name: composer | ||
volumes: | ||
- .:/var/www/html | ||
working_dir: /var/www/html | ||
depends_on: | ||
- php | ||
user: laravel | ||
networks: | ||
- app-network | ||
entrypoint: [ 'composer', '--ignore-platform-reqs' ] | ||
|
||
#Artisan Service | ||
artisan: | ||
build: | ||
context: . | ||
dockerfile: ./docker/php.dockerfile | ||
container_name: artisan | ||
volumes: | ||
- .:/var/www/html | ||
depends_on: | ||
- db | ||
working_dir: /var/www/html | ||
user: laravel | ||
entrypoint: [ 'php', '/var/www/html/artisan' ] | ||
networks: | ||
- app-network | ||
|
||
#PHPMyAdmin Service | ||
phpmyadmin: | ||
depends_on: | ||
- db | ||
image: phpmyadmin/phpmyadmin:latest | ||
container_name: phpmyadmin | ||
restart: always | ||
ports: | ||
- '${DOCKER_PHPMYADMIN_HOST}:80' | ||
environment: | ||
PMA_HOST: db | ||
UPLOAD_LIMIT: 3000000000 | ||
networks: | ||
- app-network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
if ! [ -x "$(command -v docker-compose)" ]; then | ||
echo 'docker-compose is not installed thus cannot scaffold your app. Sorry, bud...' >&2 | ||
sleep 1 | ||
exit 1 | ||
fi | ||
|
||
echo "Scaffolding your app using Docker... This will take a while..." | ||
sleep 1 | ||
sudo docker-compose up -d | ||
sudo docker-compose run --rm composer install | ||
sudo docker-compose run --rm artisan migrate:fresh | ||
|
||
export $(grep -v '#.*' .env | xargs) | ||
echo "\nUnifiedtransform is ready on localhost:$DOCKER_WEBSERVER_HOST and localhost:$DOCKER_PHPMYADMIN_HOST for the PHPMyAdmin\n" | ||
sleep 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM composer:latest | ||
|
||
RUN addgroup -g 1000 laravel && adduser -G laravel -g laravel -s /bin/sh -D laravel | ||
|
||
WORKDIR /var/www/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM nginx:stable-alpine | ||
|
||
ADD ./docker/nginx/nginx.conf /etc/nginx/nginx.conf | ||
ADD ./docker/nginx/default.conf /etc/nginx/conf.d/default.conf | ||
|
||
RUN mkdir -p /var/www/html | ||
|
||
RUN addgroup -g 1000 laravel && adduser -G laravel -g laravel -s /bin/sh -D laravel | ||
|
||
RUN chown laravel:laravel /var/www/html |
18 changes: 10 additions & 8 deletions
18
nginx/conf.d/app.conf → docker/nginx/default.conf
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
server { | ||
listen 80; | ||
index index.php index.html; | ||
error_log /var/log/nginx/error.log; | ||
access_log /var/log/nginx/access.log; | ||
root /var/www/public; | ||
server_name localhost; | ||
root /var/www/html/public; | ||
|
||
location / { | ||
root /var/www/html/public; | ||
index index.php index.html index.htm; | ||
try_files $uri $uri/ /index.php$is_args$args; | ||
} | ||
|
||
location ~ \.php$ { | ||
try_files $uri =404; | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
fastcgi_pass app:9000; | ||
fastcgi_pass php:9000; | ||
fastcgi_index index.php; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param PATH_INFO $fastcgi_path_info; | ||
} | ||
location / { | ||
try_files $uri $uri/ /index.php?$query_string; | ||
gzip_static on; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
user laravel; | ||
worker_processes auto; | ||
|
||
error_log /var/log/nginx/error.log warn; | ||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
#tcp_nopush on; | ||
|
||
keepalive_timeout 65; | ||
|
||
#gzip on; | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM php:7.4-fpm-alpine | ||
|
||
ADD ./docker/php/www.conf /usr/local/etc/php-fpm.d/www.conf | ||
ADD ./docker/php/php.ini /usr/local/etc/php/php.ini | ||
|
||
RUN addgroup -g 1000 laravel && adduser -G laravel -g laravel -s /bin/sh -D laravel | ||
|
||
RUN mkdir -p /var/www/html | ||
|
||
RUN chown laravel:laravel /var/www/html | ||
|
||
WORKDIR /var/www/html | ||
|
||
RUN docker-php-ext-install pdo pdo_mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
memory_limit = 64M | ||
upload_max_filesize = 64M | ||
post_max_size = 64M | ||
max_execution_time = 90 |
Oops, something went wrong.