Skip to content
This repository was archived by the owner on Apr 1, 2021. It is now read-only.

Commit 721e905

Browse files
committed
Merge branch 'release/1.0.0-rc.1'
2 parents 1d8f1a0 + 41855f8 commit 721e905

File tree

25 files changed

+711
-38
lines changed

25 files changed

+711
-38
lines changed

.dockerignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/node_modules
2+
/public/hot
3+
/storage/*.key
4+
/vendor
5+
/.idea
6+
/.vscode
7+
/.vagrant
8+
Dockerfile
9+
Homestead.json
10+
Homestead.yaml
11+
npm-debug.log
12+
yarn-error.log
13+
.DS_Store

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/public/images
77
/public/fonts
88
/public/mix-manifest.json
9+
/public/sw.js
910
/storage/*.key
1011
/vendor
1112
/.idea

Dockerfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
FROM node:8 AS compiler
2+
3+
LABEL maintainer="Ade Novid <adenvt@gmail.com>"
4+
5+
WORKDIR /var/www
6+
COPY package.json /var/www
7+
COPY package-lock.json /var/www
8+
RUN npm ci
9+
10+
COPY . /var/www
11+
# RUN npm run prod
12+
RUN rm -rf /var/www/node_modules/
13+
14+
FROM php:7.2-fpm AS server
15+
RUN set -x \
16+
&& apt-get update -y \
17+
&& apt-get install --no-install-recommends --no-install-suggests -y \
18+
nginx \
19+
nginx-extras \
20+
curl \
21+
git \
22+
unzip \
23+
zlib1g-dev \
24+
&& apt-get clean
25+
RUN docker-php-ext-install zip
26+
27+
WORKDIR /var/www
28+
29+
ENV TZ=Asia/Jakarta
30+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
31+
32+
ENV COMPOSER_ALLOW_SUPERUSER=1
33+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
34+
COPY composer.json composer.json
35+
COPY composer.lock composer.lock
36+
RUN composer config -g repos.packagist composer https://packagist.jp
37+
RUN composer global require hirak/prestissimo
38+
RUN composer install \
39+
--prefer-dist \
40+
--no-ansi \
41+
--no-dev \
42+
--no-interaction \
43+
--no-progress \
44+
--no-scripts \
45+
--no-autoloader \
46+
&& rm -rf /root/.composer
47+
48+
COPY deploy/web/site.conf /etc/nginx/sites-available/default
49+
COPY deploy/web/nginx.conf /etc/nginx/nginx.conf
50+
COPY deploy/web/mime.types /etc/nginx/mime.types
51+
COPY deploy/web/php.ini /usr/local/etc/php/php.ini
52+
COPY --from=compiler /var/www /var/www
53+
54+
# Force HTTPS
55+
ARG FORCE_HTTPS=false
56+
RUN if [ ${FORCE_HTTPS} = true ]; then \
57+
sed -i 's/# fastcgi_param HTTPS/fastcgi_param HTTPS/' /etc/nginx/sites-available/default \
58+
;fi
59+
60+
RUN composer dump-autoload --no-dev --optimize
61+
RUN chown -R www-data:www-data /var/www
62+
RUN php artisan config:cache \
63+
&& php artisan route:cache \
64+
&& php artisan view:cache
65+
RUN rm -rf /var/www/html/ /var/www/deploy/
66+
67+
EXPOSE 80 443
68+
69+
CMD service nginx start && php-fpm

README.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
> Laravel + CoreUI + Vue Boilerplate
44
5-
[![GitHub version](https://badge.fury.io/gh/adenvt%2Flaravel-coreui-vue.svg)](https://badge.fury.io/gh/adenvt%2Flaravel-coreui-vue)
6-
[![Greenkeeper badge](https://badges.greenkeeper.io/adenvt/laravel-coreui-vue.svg)](https://greenkeeper.io/)
5+
[![PHP version](https://badge.fury.io/ph/adenvt%2Flaravel-coreui-vue.svg)](https://badge.fury.io/ph/adenvt%2Flaravel-coreui-vue)
76

87
## What's inside
98
* [Laravel][laravel] 5.7, A PHP framework for web artisans
109
* [Core UI][coreui] for Vue, Free Bootstrap Admin Template
1110
* Usefull library: [Axios][axios], [jQuery][jquery], [Moment.js][moment], [Lodash][lodash]
1211
* [Vue Router][vue-router] and [Vuex][vuex], set out of the box
12+
* PWA ready, powered by [Offline-plugin][offline-plugin] and [Workbox][workbox]
1313
* Notification using [Vue-SweatAlert2][vue-sweatalert2] and [Vue-Notification][vue-notification]
1414
* Loading spinner with [Vue Loading Spinner][vue-loading-spinner]
15-
* Quick deployment with [Docker Compose][docker-compose] [TODO]
15+
* Quick deployment with [Docker Compose][docker-compose]
1616

1717
## Requirement
1818
* **PHP** >= 7.1.3
@@ -28,7 +28,7 @@
2828
* For Ubuntu, require `apt-get install libpng16-dev`, [see](https://github.com/imagemin/imagemin-mozjpeg/issues/28)
2929

3030
## How to Install
31-
* Install using composer
31+
* Install using composer (no need to cloning)
3232
```bash
3333
composer create-project --prefer-dist adenvt/laravel-coreui-vue project_name
3434
```
@@ -50,10 +50,51 @@ npm run dev
5050
## for Production
5151
npm run prod
5252

53-
### for Development with HMR (Hot Module Replacement)
53+
## for Development with HMR (Hot Module Replacement)
5454
npm run hot
5555
```
5656

57+
## Using Docker Compose
58+
59+
### For Development
60+
61+
* Create and run Container
62+
```bash
63+
docker-compose up -d dev
64+
```
65+
66+
* Enter workspace
67+
```bash
68+
docker-compose exec dev bash
69+
```
70+
71+
* Install Depencies
72+
```
73+
composer install
74+
npm install
75+
```
76+
* Compile Static Asset
77+
```bash
78+
## Single run compile
79+
npm run dev
80+
81+
## or watch and compile every change
82+
npm run watch
83+
84+
## or using Hot Module Replacement
85+
npm run hot
86+
```
87+
* Open browser, goto `http://localhost:8888`
88+
89+
### For Production
90+
* Create and run Container
91+
```
92+
docker-compose up -d prod
93+
```
94+
* Open browser, goto `http://localhost:88`
95+
96+
97+
5798
## License
5899
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
59100

@@ -69,3 +110,5 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
69110
[vue-notification]: http://vue-notification.yev.io/
70111
[vue-loading-spinner]: https://nguyenvanduocit.github.io/vue-loading-spinner/
71112
[docker-compose]: https://docs.docker.com/compose/
113+
[offline-plugin]: https://github.com/NekR/offline-plugin
114+
[workbox]: https://developers.google.com/web/tools/workbox/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
7+
class AppController extends Controller
8+
{
9+
public function index (Request $request) {
10+
return view('app');
11+
}
12+
}

deploy/dev/Dockerfile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
FROM php:7.2-fpm
2+
3+
LABEL maintainer="Ade Novid <adenvt@gmail.com>"
4+
5+
WORKDIR /var/www
6+
7+
RUN set -x \
8+
&& apt-get update -y \
9+
&& apt-get install --no-install-recommends --no-install-suggests -y \
10+
nginx \
11+
nginx-extras \
12+
curl \
13+
git \
14+
unzip \
15+
zlib1g-dev \
16+
gnupg \
17+
libpng-dev \
18+
vim \
19+
&& apt-get clean
20+
21+
# Install Node
22+
RUN curl --silent --location https://deb.nodesource.com/setup_8.x | bash -
23+
RUN apt-get install --no-install-recommends --no-install-suggests -y \
24+
nodejs \
25+
&& apt-get clean
26+
27+
# Install PHP Plugin
28+
RUN docker-php-ext-install zip
29+
30+
ENV TZ=Asia/Jakarta
31+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
32+
33+
# Install Composer
34+
ENV COMPOSER_ALLOW_SUPERUSER=1
35+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
36+
RUN composer config -g repos.packagist composer https://packagist.jp
37+
RUN composer global require hirak/prestissimo
38+
39+
# Configuring NGINX
40+
COPY deploy/web/site.conf /etc/nginx/sites-available/default
41+
COPY deploy/web/nginx.conf /etc/nginx/nginx.conf
42+
COPY deploy/web/mime.types /etc/nginx/mime.types
43+
COPY deploy/web/php.ini /usr/local/etc/php/
44+
45+
# Force HTTPS
46+
ARG FORCE_HTTPS=false
47+
RUN if [ ${FORCE_HTTPS} = true ]; then \
48+
sed -i 's/# fastcgi_param HTTPS/fastcgi_param HTTPS/' /etc/nginx/sites-available/default \
49+
;fi
50+
51+
# Cleanup
52+
RUN rm -rf /var/www/html/
53+
54+
EXPOSE 80 443 8080
55+
56+
ENV MIX_HMR_HOST=0.0.0.0
57+
ENV MIX_HMR_PORT=8080
58+
59+
CMD service nginx start && php-fpm

deploy/web/mime.types

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
types {
2+
3+
# Data interchange
4+
5+
application/atom+xml atom;
6+
application/json json map topojson;
7+
application/ld+json jsonld;
8+
application/rss+xml rss;
9+
application/vnd.geo+json geojson;
10+
application/xml rdf xml;
11+
12+
13+
# JavaScript
14+
15+
# Normalize to standard type.
16+
# https://tools.ietf.org/html/rfc4329#section-7.2
17+
application/javascript js;
18+
19+
20+
# Manifest files
21+
22+
application/manifest+json webmanifest;
23+
application/x-web-app-manifest+json webapp;
24+
text/cache-manifest appcache;
25+
26+
27+
# Media files
28+
29+
audio/midi mid midi kar;
30+
audio/mp4 aac f4a f4b m4a;
31+
audio/mpeg mp3;
32+
audio/ogg oga ogg opus;
33+
audio/x-realaudio ra;
34+
audio/x-wav wav;
35+
image/bmp bmp;
36+
image/gif gif;
37+
image/jpeg jpeg jpg;
38+
image/jxr jxr hdp wdp;
39+
image/png png;
40+
image/svg+xml svg svgz;
41+
image/tiff tif tiff;
42+
image/vnd.wap.wbmp wbmp;
43+
image/webp webp;
44+
image/x-jng jng;
45+
video/3gpp 3gp 3gpp;
46+
video/mp4 f4p f4v m4v mp4;
47+
video/mpeg mpeg mpg;
48+
video/ogg ogv;
49+
video/quicktime mov;
50+
video/webm webm;
51+
video/x-flv flv;
52+
video/x-mng mng;
53+
video/x-ms-asf asf asx;
54+
video/x-ms-wmv wmv;
55+
video/x-msvideo avi;
56+
57+
# Serving `.ico` image files with a different media type
58+
# prevents Internet Explorer from displaying then as images:
59+
# https://github.com/h5bp/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee
60+
61+
image/x-icon cur ico;
62+
63+
64+
# Microsoft Office
65+
66+
application/msword doc;
67+
application/vnd.ms-excel xls;
68+
application/vnd.ms-powerpoint ppt;
69+
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
70+
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
71+
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
72+
73+
74+
# Web fonts
75+
76+
application/font-woff woff;
77+
application/font-woff2 woff2;
78+
application/vnd.ms-fontobject eot;
79+
80+
# Browsers usually ignore the font media types and simply sniff
81+
# the bytes to figure out the font type.
82+
# https://mimesniff.spec.whatwg.org/#matching-a-font-type-pattern
83+
#
84+
# However, Blink and WebKit based browsers will show a warning
85+
# in the console if the following font types are served with any
86+
# other media types.
87+
88+
application/x-font-ttf ttc ttf;
89+
font/opentype otf;
90+
91+
92+
# Other
93+
94+
application/java-archive ear jar war;
95+
application/mac-binhex40 hqx;
96+
application/octet-stream bin deb dll dmg exe img iso msi msm msp safariextz;
97+
application/pdf pdf;
98+
application/postscript ai eps ps;
99+
application/rtf rtf;
100+
application/vnd.google-earth.kml+xml kml;
101+
application/vnd.google-earth.kmz kmz;
102+
application/vnd.wap.wmlc wmlc;
103+
application/x-7z-compressed 7z;
104+
application/x-bb-appworld bbaw;
105+
application/x-bittorrent torrent;
106+
application/x-chrome-extension crx;
107+
application/x-cocoa cco;
108+
application/x-java-archive-diff jardiff;
109+
application/x-java-jnlp-file jnlp;
110+
application/x-makeself run;
111+
application/x-opera-extension oex;
112+
application/x-perl pl pm;
113+
application/x-pilot pdb prc;
114+
application/x-rar-compressed rar;
115+
application/x-redhat-package-manager rpm;
116+
application/x-sea sea;
117+
application/x-shockwave-flash swf;
118+
application/x-stuffit sit;
119+
application/x-tcl tcl tk;
120+
application/x-x509-ca-cert crt der pem;
121+
application/x-xpinstall xpi;
122+
application/xhtml+xml xhtml;
123+
application/xslt+xml xsl;
124+
application/zip zip;
125+
text/css css;
126+
text/csv csv;
127+
text/html htm html shtml;
128+
text/markdown md;
129+
text/mathml mml;
130+
text/plain txt;
131+
text/vcard vcard vcf;
132+
text/vnd.rim.location.xloc xloc;
133+
text/vnd.sun.j2me.app-descriptor jad;
134+
text/vnd.wap.wml wml;
135+
text/vtt vtt;
136+
text/x-component htc;
137+
138+
}

0 commit comments

Comments
 (0)