[go: nahoru, domu]

Skip to content

Commit

Permalink
feat: update docekr
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangsx committed Jul 6, 2023
1 parent 604ab45 commit 5d449a0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@ FROM ghcr.io/puppeteer/puppeteer:20.5.0

USER root

WORKDIR /usr/src/app
WORKDIR /usr/src/build

COPY --chown=pptruser package.json /usr/src/app/
COPY --chown=pptruser package.json /usr/src/build/

RUN npm i --registry=https://registry.npm.taobao.org

COPY --chown=pptruser . /usr/src/app
COPY --chown=pptruser . /usr/src/build

RUN npm run build

RUN mkdir /usr/src/app/
RUN cp ./dist/* /usr/src/app/ -r
RUN cp ./node_modules /usr/src/app/ -r
RUN rm /usr/src/build -rf
WORKDIR /usr/src/app

VOLUME [ "/usr/src/app/run" ]

EXPOSE 3000

CMD npm start
CMD ["node", "index.js"]
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"test": "ts-node test.ts",
"start": "ts-node index.ts"
"start": "ts-node index.ts",
"build": "tsc"
},
"keywords": [
"git4free",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */

"outDir": "dist",
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
Expand Down

0 comments on commit 5d449a0

Please sign in to comment.