File tree Expand file tree Collapse file tree 10 files changed +64
-12
lines changed
Expand file tree Collapse file tree 10 files changed +64
-12
lines changed Original file line number Diff line number Diff line change 1010jobs :
1111 test :
1212 runs-on : ubuntu-latest
13-
13+
1414 steps :
1515 - uses : actions/checkout@v3
16-
16+
1717 - name : Setup Node.js
1818 uses : actions/setup-node@v3
1919 with :
20- node-version : ' 18 '
20+ node-version : ' 20 '
2121 cache : ' yarn'
22-
22+
2323 - name : Install dependencies
2424 run : yarn install --frozen-lockfile
25-
25+
2626 - name : Run tests
27- run : yarn test
27+ run : yarn test
Original file line number Diff line number Diff line change 1313
1414
1515[ ![ NPM] ( https://img.shields.io/npm/v/@acrool/node-docker-cli.svg?style=for-the-badge )] ( https://www.npmjs.com/package/@acrool/node-docker-cli )
16- [ ![ npm] ( https://img.shields.io/bundlejs/size/@acrool/node-docker-cli?style=for-the-badge )] ( https://github.com/acrool/ @acrool/node-docker-cli/blob/main/LICENSE )
16+ [ ![ npm] ( https://img.shields.io/bundlejs/size/@acrool/node-docker-cli?style=for-the-badge )] ( https://github.com/@acrool/node-docker-cli/blob/main/LICENSE )
1717[ ![ npm] ( https://img.shields.io/npm/l/@acrool/node-docker-cli?style=for-the-badge )] ( https://github.com/acrool/node-docker-cli/blob/main/LICENSE )
1818
1919[ ![ npm downloads] ( https://img.shields.io/npm/dm/@acrool/node-docker-cli.svg?style=for-the-badge )] ( https://www.npmjs.com/package/@acrool/node-docker-cli )
Original file line number Diff line number Diff line change 1+ FROM node:18.3.0-alpine AS builder
2+ ARG MAX_OLD_SPACE_SIZE=2048
3+ WORKDIR /opt/app/
4+ COPY package.json yarn.lock ./
5+ RUN awk '/},/ { p = 0 } { if (!p) { print $0 } } /"devDependencies":/ { p = 1 }' package.json > package.json.tmp && mv package.json.tmp package.json && yarn install --prod --frozen-lockfile
6+ COPY . .
7+ RUN yarn build
8+ RUN mkdir ./copy-tmp && \
9+ mv asset ./copy-tmp && \
10+ mv node_modules ./copy-tmp && \
11+ mv dist ./copy-tmp
12+
13+
14+ # And then copy over node_modules, etc from that stage to the smaller base image
15+ FROM node:18.3.0-alpine
16+ WORKDIR /opt/app/
17+ COPY --from=builder /opt/app/copy-tmp .
18+ RUN mkdir /tmp/bearests
19+
20+ EXPOSE 8080
21+ CMD ["node" , "--max_old_space_size=$MAX_OLD_SPACE_SIZE" , "dist/main.js" ]
Original file line number Diff line number Diff line change 1+ FROM node:18.3.0-alpine AS builder
2+ ARG REACT_APP_CDN_ASSETS_PATH
3+ ARG PUBLIC_URL
4+ WORKDIR /opt/app/
5+ COPY package.json yarn.lock ./
6+ RUN awk '/},/ { p = 0 } { if (!p) { print $0 } } /"devDependencies":/ { p = 1 }' package.json > package.json.tmp && mv package.json.tmp package.json && yarn install --prod --frozen-lockfile
7+ COPY ../.. .
8+ ENV REACT_APP_CDN_ASSETS_PATH=$REACT_APP_CDN_ASSETS_PATH
9+ ENV PUBLIC_URL=$PUBLIC_URL
10+ RUN yarn build
11+
12+ # And then copy over node_modules, etc from that stage to the smaller base image
13+ FROM nginx:1.21-alpine
14+ COPY --from=builder /opt/app/build /usr/share/nginx/html
15+ COPY deploy/config/nginx/nginx.conf /etc/nginx/conf.d/default.conf
16+ WORKDIR /usr/share/nginx/html
17+ EXPOSE 80
18+ CMD ["nginx" , "-g" , "daemon off;" ]
Original file line number Diff line number Diff line change 1+ server {
2+
3+ listen 80 ;
4+ root /usr/share/nginx/html;
5+ index index .html index .htm;
6+
7+ location / {
8+ try_files $uri /index .html;
9+ }
10+
11+ error_page 500 502 503 504 /50x .html;
12+ }
Original file line number Diff line number Diff line change 1818 "acrool-node-docker-cli" : " dist/bin/cli.js"
1919 },
2020 "files" : [
21- " dist"
21+ " dist" ,
22+ " config"
2223 ],
2324 "engines" : {
2425 "npm" : " >=6" ,
25- "node" : " >=18.20.0 "
26+ "node" : " >=20 "
2627 },
2728 "scripts" : {
2829 "build" : " run-s build:claer && tsc --project ./tsconfig.build.json && run-s copy-dts && run-s chmodBin" ,
Original file line number Diff line number Diff line change 11import logger from '@acrool/js-logger' ;
22import prompts from 'prompts' ;
33
4- import { defaultConfig } from '../../config .js' ;
4+ import { defaultConfig } from '../../setting .js' ;
55import { bash } from '../../utils.js' ;
66import { main as pushDocker } from '../push/index.js' ;
77import { IBuildArgs } from './types.js' ;
Original file line number Diff line number Diff line change 11import logger from '@acrool/js-logger' ;
22import prompts from 'prompts' ;
33
4- import { defaultConfig } from '../../config .js' ;
4+ import { defaultConfig } from '../../setting .js' ;
55import { bash , renameDockerImage } from '../../utils.js' ;
66import { main as removeDocker } from '../remove/index.js' ;
77import { IPushArgs } from './types.js' ;
Original file line number Diff line number Diff line change 11import logger from '@acrool/js-logger' ;
22
3- import { defaultConfig } from '../../config .js' ;
3+ import { defaultConfig } from '../../setting .js' ;
44import { bash , renameDockerImage } from '../../utils.js' ;
55import { IRemoveArgs } from './types.js' ;
66
File renamed without changes.
You can’t perform that action at this time.
0 commit comments