Browse Source
* add docker support * remove test:all to package.json * add gzip configpull/2485/head
committed by
GitHub
10 changed files with 121 additions and 21 deletions
@ -0,0 +1,38 @@ |
|||||
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. |
||||
|
|
||||
|
# dependencies |
||||
|
**/node_modules |
||||
|
# roadhog-api-doc ignore |
||||
|
/src/utils/request-temp.js |
||||
|
_roadhog-api-doc |
||||
|
|
||||
|
# production |
||||
|
/dist |
||||
|
/.vscode |
||||
|
|
||||
|
# misc |
||||
|
.DS_Store |
||||
|
npm-debug.log* |
||||
|
yarn-error.log |
||||
|
|
||||
|
/coverage |
||||
|
.idea |
||||
|
yarn.lock |
||||
|
package-lock.json |
||||
|
*bak |
||||
|
.vscode |
||||
|
|
||||
|
# visual studio code |
||||
|
.history |
||||
|
*.log |
||||
|
|
||||
|
functions/mock |
||||
|
.temp/** |
||||
|
|
||||
|
# umi |
||||
|
.umi |
||||
|
.umi-production |
||||
|
|
||||
|
# screenshot |
||||
|
screenshot |
||||
|
.firebase |
||||
@ -0,0 +1,17 @@ |
|||||
|
FROM node:latest |
||||
|
|
||||
|
WORKDIR /usr/src/app/ |
||||
|
|
||||
|
COPY package.json ./ |
||||
|
RUN npm install --silent --no-cache |
||||
|
|
||||
|
COPY ./ ./ |
||||
|
|
||||
|
RUN apt-get update |
||||
|
RUN apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \ |
||||
|
libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \ |
||||
|
libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \ |
||||
|
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \ |
||||
|
ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget |
||||
|
|
||||
|
CMD ["npm", "run", "build"] |
||||
@ -1,13 +0,0 @@ |
|||||
FROM node:latest |
|
||||
|
|
||||
WORKDIR /usr/src/app/ |
|
||||
|
|
||||
COPY package.json ./ |
|
||||
RUN npm install --silent --no-cache |
|
||||
|
|
||||
COPY ./ ./ |
|
||||
|
|
||||
RUN sh ./tests/fix_puppeteer.sh |
|
||||
RUN npm run test:all |
|
||||
|
|
||||
CMD ["npm", "run", "build"] |
|
||||
@ -1,9 +1,22 @@ |
|||||
server { |
server { |
||||
listen 80; |
listen 80; |
||||
|
# gzip config |
||||
|
gzip on; |
||||
|
gzip_min_length 1k; |
||||
|
gzip_comp_level 9 |
||||
|
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; |
||||
|
gzip_vary on; |
||||
|
gzip_disable "MSIE [1-6]\."; |
||||
|
|
||||
root /usr/share/nginx/html; |
root /usr/share/nginx/html; |
||||
|
|
||||
location / { |
location / { |
||||
try_files $uri $uri/ /index.html; |
try_files $uri $uri/ /index.html; |
||||
} |
} |
||||
|
location /api { |
||||
|
proxy_pass https://preview.pro.ant.design; |
||||
|
proxy_set_header X-Forwarded-Proto $scheme; |
||||
|
proxy_set_header Host $http_host; |
||||
|
proxy_set_header X-Real-IP $remote_addr; |
||||
|
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue