Skip to content

Commit b3b60f8

Browse files
authored
Merge pull request #87 from styfle/dockerfile
Dockerfile
2 parents 9d086c7 + fa481de commit b3b60f8

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.vscode
2+
README.md
3+
LICENSE
4+
tests
5+
dist

Dockerfile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM mhart/alpine-node:8.11.2 as build
2+
WORKDIR /usr/app
3+
COPY . .
4+
RUN npm install --only=production
5+
RUN mv node_modules prod_modules
6+
RUN npm install
7+
ENV NODE_ENV production
8+
RUN npm run build
9+
10+
FROM mhart/alpine-node:base-8.11.2
11+
WORKDIR /usr/app
12+
ENV NODE_ENV production
13+
COPY --from=build /usr/app/prod_modules ./node_modules
14+
COPY --from=build /usr/app/dist ./dist
15+
COPY --from=build /usr/app/package.json ./package.json
16+
COPY --from=build /usr/app/src/style.min.css ./src/style.min.css
17+
EXPOSE 3007
18+
CMD node dist/server.js

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"prettier": "prettier \"./src/**/*.ts\" \"./src/**/*.tsx\" --write",
1212
"test": "tsc --outDir . --sourceMap false && tape tests/**/*.js",
1313
"release": "npm version patch && git push --follow-tags && npm publish",
14-
"deploy": "now --public && now alias"
14+
"deploy": "now --docker --public && now alias"
1515
},
1616
"license": "MIT",
1717
"dependencies": {

0 commit comments

Comments
 (0)