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
8
8
RUN npm ci
9
9
10
10
COPY . /var/www
11
- RUN npm run prod
11
+ # RUN npm run prod
12
12
RUN rm -rf /var/www/node_modules/
13
13
14
14
FROM php:7.2-fpm AS server
@@ -51,6 +51,12 @@ COPY deploy/web/mime.types /etc/nginx/mime.types
51
51
COPY deploy/web/php.ini /usr/local/etc/php/php.ini
52
52
COPY --from=compiler /var/www /var/www
53
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
+
54
60
RUN composer dump-autoload --no-dev --optimize
55
61
RUN chown -R www-data:www-data /var/www
56
62
RUN php artisan config:cache \
Original file line number Diff line number Diff line change @@ -84,14 +84,14 @@ npm run watch
84
84
# # or using Hot Module Replacement
85
85
npm run hot
86
86
```
87
- * Open browser, goto ` http://localhost:8080 `
87
+ * Open browser, goto ` http://localhost:8888 `
88
88
89
89
### For Production
90
90
* Create and run Container
91
91
```
92
92
docker-compose up -d prod
93
93
```
94
- * Open browser, goto ` http://localhost:8888 `
94
+ * Open browser, goto ` http://localhost:88 `
95
95
96
96
97
97
Original file line number Diff line number Diff line change @@ -13,12 +13,16 @@ RUN set -x \
13
13
git \
14
14
unzip \
15
15
zlib1g-dev \
16
- gnupg
16
+ gnupg \
17
+ libpng-dev \
18
+ vim \
19
+ && apt-get clean
17
20
18
21
# Install Node
19
22
RUN curl --silent --location https://deb.nodesource.com/setup_8.x | bash -
20
23
RUN apt-get install --no-install-recommends --no-install-suggests -y \
21
- nodejs
24
+ nodejs \
25
+ && apt-get clean
22
26
23
27
# Install PHP Plugin
24
28
RUN docker-php-ext-install zip
@@ -29,6 +33,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
29
33
# Install Composer
30
34
ENV COMPOSER_ALLOW_SUPERUSER=1
31
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
32
37
RUN composer global require hirak/prestissimo
33
38
34
39
# Configuring NGINX
@@ -37,8 +42,18 @@ COPY deploy/web/nginx.conf /etc/nginx/nginx.conf
37
42
COPY deploy/web/mime.types /etc/nginx/mime.types
38
43
COPY deploy/web/php.ini /usr/local/etc/php/
39
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
40
52
RUN rm -rf /var/www/html/
41
53
42
54
EXPOSE 80 443 8080
43
55
56
+ ENV MIX_HMR_HOST=0.0.0.0
57
+ ENV MIX_HMR_PORT=8080
58
+
44
59
CMD service nginx start && php-fpm
Original file line number Diff line number Diff line change 4
4
error_log /var/log/nginx/error.log;
5
5
access_log /var/log/nginx/access.log;
6
6
7
- root $root_path;
7
+ root $root_path;
8
8
index index.php;
9
+ server_name _;
9
10
10
11
add_header X-Frame-Options "SAMEORIGIN";
11
12
add_header X-XSS-Protection "1; mode=block";
@@ -31,7 +32,7 @@ server {
31
32
fastcgi_pass 127.0.0.1:9000;
32
33
fastcgi_split_path_info ^(.+\.php)(/.+)$;
33
34
fastcgi_intercept_errors on;
34
- fastcgi_param HTTPS on;
35
+ # fastcgi_param HTTPS on;
35
36
fastcgi_param PATH_INFO $fastcgi_path_info;
36
37
fastcgi_param SCRIPT_FILENAME $root_path$fastcgi_script_name;
37
38
}
Original file line number Diff line number Diff line change 1
1
version : ' 3'
2
2
services :
3
3
prod :
4
- build : ./
4
+ build :
5
+ context : ./
6
+ args :
7
+ - FORCE_HTTPS=false
5
8
ports :
6
- - 8888 :80
9
+ - 88 :80
7
10
dev :
8
11
build :
9
12
context : ./
10
13
dockerfile : deploy/dev/Dockerfile
14
+ args :
15
+ - FORCE_HTTPS=false
11
16
volumes :
12
17
- ./:/var/www
13
18
ports :
19
+ - 8888:80
14
20
- 8080:8080
15
- - 8000:80
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ mix.extract([
84
84
85
85
mix . options ( {
86
86
hmrOptions : {
87
- host : '0.0.0.0' ,
88
- port : 8080 ,
87
+ host : process . env . MIX_HMR_HOST ,
88
+ port : process . env . MIX_HMR_PORT ,
89
89
} ,
90
90
uglify : { parallel : true } ,
91
91
} )
You can’t perform that action at this time.
0 commit comments