diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9efcd1c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM php:7.1.3 +RUN apt-get update -y && apt-get install -y openssl zip unzip git zlib1g-dev netcat mysql-client libgd-dev libfreetype6-dev libjpeg62-turbo-dev libpng12-dev +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ +RUN docker-php-ext-install pdo pdo_mysql zip gd +WORKDIR /app +COPY . /app +RUN composer install + +COPY wait.sh /usr/local/bin/wait.sh +RUN chmod +x /usr/local/bin/wait.sh +CMD /usr/local/bin/wait.sh && composer dumpautoload && php artisan storage:link && php artisan migrate && php artisan db:seed && php artisan serve --host=0.0.0.0 --port=8000 +EXPOSE 8000 diff --git a/database/seeds/CompanySeeder.php b/database/seeds/CompanySeeder.php index c4f6c9b..16c63a4 100644 --- a/database/seeds/CompanySeeder.php +++ b/database/seeds/CompanySeeder.php @@ -12,8 +12,8 @@ class CompanySeeder extends Seeder */ public function run() { + DB::table('companies')->truncate(); DB::table('companies')->insert([ - 'id' => '999', 'company_profile'=>'testing', 'reg_cert'=>'12345', diff --git a/docker-compose.yml b/docker-compose.yml index 1def6b5..2e0a424 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,5 @@ -version: '2' +version: '3' services: - app: - build: . - ports: - - "8000:8000" - volumes: - - .:/app - env_file: .env - working_dir: /app - command: bash -c 'php artisan migrate && php artisan serve --host 0.0.0.0' - depends_on: - - mysql - links: - - mysql mysql: build: context: ./docker/mysql @@ -30,6 +17,20 @@ services: ports: - "3306:3306" + app: + build: . + ports: + - "8000:8000" + volumes: + - .:/app + env_file: .env + working_dir: /app + depends_on: + - mysql + links: + - mysql + + phpmyadmin: depends_on: - mysql @@ -39,4 +40,4 @@ services: - 8090:80 environment: PMA_HOST: mysql - MYSQL_ROOT_PASSWORD: root \ No newline at end of file + MYSQL_ROOT_PASSWORD: root diff --git a/readme.md b/readme.md index 5e90f48..ce0e683 100644 --- a/readme.md +++ b/readme.md @@ -1,59 +1,26 @@ -

+# IZYIM (Easy Import) + +> A system for importer to place shipping order and freight forwarder to manage the process from receiving shipping order, warehouse receive process, custom declaration until delivery scheduling to the importer address.

-Build Status -Total Downloads -Latest Stable Version -License +

-## About Laravel +## TechStack -Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as: +- Laravel 5.6 +- Docker compose +- HTML, CSS, Jquery +- Authentication with JWT -- [Simple, fast routing engine](https://laravel.com/docs/routing). -- [Powerful dependency injection container](https://laravel.com/docs/container). -- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. -- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). -- Database agnostic [schema migrations](https://laravel.com/docs/migrations). -- [Robust background job processing](https://laravel.com/docs/queues). -- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). +## Installation -Laravel is accessible, yet powerful, providing tools needed for large, robust applications. +- `git clone git@gitlab.com:CIEFWorldwideSdnBhd/izyim-api.git` +- Copy `.env-example` to `.env` +- Edit `.env` and set your database connection details -## Learning Laravel +## Usage +- Run `docker-compose up` -Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of any modern web application framework, making it a breeze to get started learning the framework. - -If you're not in the mood to read, [Laracasts](https://laracasts.com) contains over 1100 video tutorials on a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library. - -## Laravel Sponsors - -We would like to extend our thanks to the following sponsors for helping fund on-going Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell): - -- **[Vehikl](https://vehikl.com/)** -- **[Tighten Co.](https://tighten.co)** -- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** -- **[British Software Development](https://www.britishsoftware.co)** -- [Fragrantica](https://www.fragrantica.com) -- [SOFTonSOFA](https://softonsofa.com/) -- [User10](https://user10.com) -- [Soumettre.fr](https://soumettre.fr/) -- [CodeBrisk](https://codebrisk.com) -- [1Forge](https://1forge.com) -- [TECPRESSO](https://tecpresso.co.jp/) -- [Pulse Storm](http://www.pulsestorm.net/) -- [Runtime Converter](http://runtimeconverter.com/) -- [WebL'Agence](https://weblagence.com/) - -## Contributing - -Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). - -## Security Vulnerabilities - -If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. - -## License - -The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). +#### Test Credentials +TBD diff --git a/start.sh b/start.sh deleted file mode 100644 index b41ad39..0000000 --- a/start.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -while ! nc -z db 3306; do sleep 3; done -php artisan db:seed && php artisan serve --host=0.0.0.0 --port=8000 \ No newline at end of file diff --git a/wait.sh b/wait.sh new file mode 100644 index 0000000..60ec004 --- /dev/null +++ b/wait.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +HOST="mysql" +PORT="3306" +USER="default" +PASSWORD="secret" +DATABASE="default" + +echo "Waiting for mysql" +until nc -w 1 -z mysql 3306 &> /dev/null +do + printf "." + sleep 1 +done + +echo -e "\nmysql ready"