This repository has been archived by the owner on Jun 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use builder container + Zeit PKG * use webpack to compile the build before packaging * remove ununsed code * update docs
- Loading branch information
Showing
12 changed files
with
9,311 additions
and
3,420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
node_modules | ||
app.min.js | ||
stats.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
FROM node:9.6.1-alpine | ||
|
||
RUN mkdir -p /usr/src/app | ||
FROM node:9.6.1-alpine as builder | ||
RUN apk update && apk upgrade && \ | ||
apk add --no-cache bash git openssh | ||
WORKDIR /usr/src/app | ||
|
||
ENV NODE_ENV production | ||
|
||
COPY package.json /usr/src/app | ||
COPY . /usr/src/app | ||
RUN npm install | ||
|
||
COPY src/ /usr/src/app/src/ | ||
|
||
EXPOSE 80 | ||
|
||
CMD npm run serve | ||
RUN npm run build | ||
RUN npm install -g pkg | ||
RUN /usr/local/bin/pkg -t node8-alpine-x64 app.min.js -o binary | ||
|
||
FROM alpine:latest | ||
RUN apk update && apk add --no-cache libstdc++ libgcc | ||
WORKDIR /root/ | ||
COPY --from=builder /usr/src/app/binary binary | ||
CMD ["./binary"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const MongoDBCore = {} | ||
const Server = function() { | ||
this.connection = { | ||
command: (cmd, args, cb) => | ||
cb(null, { | ||
result: { | ||
ok: 1, | ||
}, | ||
}), | ||
destroy: () => {}, | ||
} | ||
this.on = (type, cb) => { | ||
if (type === 'connect') { | ||
this.connectCb = cb | ||
} | ||
} | ||
this.connect = () => this.connectCb(this.connection) | ||
} | ||
MongoDBCore.Server = jest.fn(Server) | ||
module.exports = MongoDBCore |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.