This repository was archived by the owner on Apr 1, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +39
-12
lines changed Expand file tree Collapse file tree 6 files changed +39
-12
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ COPY package-lock.json /var/www
88RUN npm ci
99
1010COPY . /var/www
11- RUN npm run prod
11+ # RUN npm run prod
1212RUN rm -rf /var/www/node_modules/
1313
1414FROM php:7.2-fpm AS server
@@ -51,6 +51,12 @@ COPY deploy/web/mime.types /etc/nginx/mime.types
5151COPY deploy/web/php.ini /usr/local/etc/php/php.ini
5252COPY --from=compiler /var/www /var/www
5353
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+
5460RUN composer dump-autoload --no-dev --optimize
5561RUN chown -R www-data:www-data /var/www
5662RUN php artisan config:cache \
Original file line number Diff line number Diff line change @@ -84,14 +84,14 @@ npm run watch
8484# # or using Hot Module Replacement
8585npm run hot
8686```
87- * Open browser, goto ` http://localhost:8080 `
87+ * Open browser, goto ` http://localhost:8888 `
8888
8989### For Production
9090* Create and run Container
9191```
9292docker-compose up -d prod
9393```
94- * Open browser, goto ` http://localhost:8888 `
94+ * Open browser, goto ` http://localhost:88 `
9595
9696
9797
Original file line number Diff line number Diff line change @@ -13,12 +13,16 @@ RUN set -x \
1313 git \
1414 unzip \
1515 zlib1g-dev \
16- gnupg
16+ gnupg \
17+ libpng-dev \
18+ vim \
19+ && apt-get clean
1720
1821# Install Node
1922RUN curl --silent --location https://deb.nodesource.com/setup_8.x | bash -
2023RUN apt-get install --no-install-recommends --no-install-suggests -y \
21- nodejs
24+ nodejs \
25+ && apt-get clean
2226
2327# Install PHP Plugin
2428RUN docker-php-ext-install zip
@@ -29,6 +33,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
2933# Install Composer
3034ENV COMPOSER_ALLOW_SUPERUSER=1
3135RUN 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
3237RUN composer global require hirak/prestissimo
3338
3439# Configuring NGINX
@@ -37,8 +42,18 @@ COPY deploy/web/nginx.conf /etc/nginx/nginx.conf
3742COPY deploy/web/mime.types /etc/nginx/mime.types
3843COPY deploy/web/php.ini /usr/local/etc/php/
3944
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
4052RUN rm -rf /var/www/html/
4153
4254EXPOSE 80 443 8080
4355
56+ ENV MIX_HMR_HOST=0.0.0.0
57+ ENV MIX_HMR_PORT=8080
58+
4459CMD service nginx start && php-fpm
Original file line number Diff line number Diff line change 44 error_log /var/log/nginx/error.log;
55 access_log /var/log/nginx/access.log;
66
7- root $root_path;
7+ root $root_path;
88 index index.php;
9+ server_name _;
910
1011 add_header X-Frame-Options "SAMEORIGIN";
1112 add_header X-XSS-Protection "1; mode=block";
@@ -31,7 +32,7 @@ server {
3132 fastcgi_pass 127.0.0.1:9000;
3233 fastcgi_split_path_info ^(.+\.php)(/.+)$;
3334 fastcgi_intercept_errors on;
34- fastcgi_param HTTPS on;
35+ # fastcgi_param HTTPS on;
3536 fastcgi_param PATH_INFO $fastcgi_path_info;
3637 fastcgi_param SCRIPT_FILENAME $root_path$fastcgi_script_name;
3738 }
Original file line number Diff line number Diff line change 11version : ' 3'
22services :
33 prod :
4- build : ./
4+ build :
5+ context : ./
6+ args :
7+ - FORCE_HTTPS=false
58 ports :
6- - 8888 :80
9+ - 88 :80
710 dev :
811 build :
912 context : ./
1013 dockerfile : deploy/dev/Dockerfile
14+ args :
15+ - FORCE_HTTPS=false
1116 volumes :
1217 - ./:/var/www
1318 ports :
19+ - 8888:80
1420 - 8080:8080
15- - 8000:80
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ mix.extract([
8484
8585mix . options ( {
8686 hmrOptions : {
87- host : '0.0.0.0' ,
88- port : 8080 ,
87+ host : process . env . MIX_HMR_HOST ,
88+ port : process . env . MIX_HMR_PORT ,
8989 } ,
9090 uglify : { parallel : true } ,
9191} )
You can’t perform that action at this time.
0 commit comments