Compile TS during Docker image build

This commit is contained in:
Paul Munteanu 2021-05-29 21:36:19 +03:00
parent dd24e49be1
commit f5461b5420
No known key found for this signature in database
GPG Key ID: 4C0797E4861E8917
2 changed files with 2 additions and 1 deletions

View File

@ -8,5 +8,6 @@ RUN apk --no-cache --virtual build-dependencies add \
RUN npm install RUN npm install
RUN apk del build-dependencies RUN apk del build-dependencies
COPY . . COPY . .
RUN npm run build
EXPOSE 3002 EXPOSE 3002
CMD ["npm", "start"] CMD ["npm", "start"]

View File

@ -5,7 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"start": "npm run build && node dist/", "start": "node dist/",
"build": "npx tsc -b .", "build": "npx tsc -b .",
"dev": "tsnd --respawn src/index.ts" "dev": "tsnd --respawn src/index.ts"
}, },