This repository has been archived by the owner on Aug 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
package.json updated, webp, fonts, docker
- Loading branch information
Showing
44 changed files
with
3,874 additions
and
3,311 deletions.
There are no files selected for viewing
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,24 +1,16 @@ | ||
# app | ||
FROM node:10.14.1-alpine as app | ||
FROM node:10.14.1-alpine as build-stage | ||
WORKDIR /app | ||
EXPOSE 8080 | ||
CMD yarn install && yarn serve | ||
COPY package*.json ./ | ||
COPY . . | ||
RUN \ | ||
yarn install && \ | ||
yarn build | ||
|
||
# storybook | ||
FROM node:10.14.1-alpine as storybook | ||
WORKDIR /app | ||
EXPOSE 8081 | ||
CMD yarn install && yarn serve:storybook | ||
|
||
# docs | ||
FROM node:10.14.1-alpine as docs | ||
WORKDIR /app | ||
EXPOSE 8082 | ||
CMD yarn install && yarn docs:dev | ||
|
||
# mock server | ||
FROM node:10.14.1-alpine as mockserver | ||
RUN npm install -g json-server | ||
WORKDIR /data | ||
EXPOSE 8090 | ||
CMD json-server --watch db.json --port 8090 --host 0.0.0.0 | ||
# production stage | ||
FROM nginx:1.15.2-alpine as production-stage | ||
COPY --from=build-stage /app/dist /var/www | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY ssl /etc/ssl | ||
EXPOSE 80 | ||
EXPOSE 443 | ||
CMD ["nginx", "-g", "daemon off;"] |
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,8 @@ | ||
# app | ||
FROM node:10.14.1-alpine as dev-stage | ||
WORKDIR /app | ||
|
||
# mock server | ||
FROM node:10.14.1-alpine as mock-server | ||
RUN npm install -g nodemon | ||
WORKDIR /data |
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
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
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,90 @@ | ||
# auto detects a good number of processes to run | ||
worker_processes auto; | ||
|
||
# Provides the configuration file context in which the directives that affect connection processing are specified. | ||
events { | ||
# Sets the maximum number of simultaneous connections that can be opened by a worker process. | ||
worker_connections 8000; | ||
# Tells the worker to accept multiple connections at a time | ||
multi_accept on; | ||
} | ||
|
||
|
||
http { | ||
# what times to include | ||
include /etc/nginx/mime.types; | ||
# what is the default one | ||
default_type application/octet-stream; | ||
|
||
# Sets the path, format, and configuration for a buffered log write | ||
log_format compression '$remote_addr - $remote_user [$time_local] ' | ||
'"$request" $status $upstream_addr ' | ||
'"$http_referer" "$http_user_agent"'; | ||
|
||
server { | ||
listen 80; | ||
server_name paws.local; | ||
return 301 https://$host$request_uri; | ||
} | ||
|
||
server { | ||
# listen on port 80 | ||
listen 443 ssl http2; | ||
# listen 80; | ||
server_name paws.local; | ||
|
||
ssl_certificate /etc/ssl/server.crt; | ||
ssl_certificate_key /etc/ssl/server.key; | ||
|
||
# Gzip Settings | ||
gzip on; | ||
gzip_static on; # allows pre-serving of .gz file if it exists | ||
gzip_disable "msie6"; # Disable for user-agent Internet explorer 6. Not supported. | ||
gzip_proxied any; # enable gzip for all proxied requests | ||
gzip_buffers 16 8k; # number and size of buffers to compress a response | ||
gzip_http_version 1.1; | ||
gzip_min_length 256; # Only gzip files of size in bytes | ||
gzip_types text/plain text/css text/html application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon; | ||
gunzip on; # Uncompress on the fly | ||
|
||
# save logs here | ||
access_log /var/log/nginx/access.log compression; | ||
|
||
# where the root here | ||
root /var/www; | ||
# what file to server as index | ||
index index.html index.htm; | ||
|
||
location / { | ||
# First attempt to serve request as file, then | ||
# as directory, then fall back to redirecting to index.html | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
# Media: images, icons, video, audio, HTC | ||
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|webp)$ { | ||
expires 1M; | ||
access_log off; | ||
add_header Cache-Control "public"; | ||
} | ||
|
||
# Javascript and CSS files | ||
location ~* (service-worker\.js)$ { | ||
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; | ||
expires off; | ||
proxy_no_cache 1; | ||
} | ||
|
||
location ~* \.(?:css|js)$ { | ||
try_files $uri =404; | ||
expires 1y; | ||
access_log off; | ||
add_header Cache-Control "public"; | ||
} | ||
|
||
# Any route containing a file extension (e.g. /devicesfile.js) | ||
location ~ ^.+\..+$ { | ||
try_files $uri =404; | ||
} | ||
} | ||
} |
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
Binary file not shown.
Oops, something went wrong.