diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..8930602f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +node_modules +logs +*.log +coverage +lib +.idea diff --git a/.gitignore b/.gitignore index 9fa994f7..f29a4541 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,5 @@ lerna-debug.log* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json -!.vscode/extensions.json \ No newline at end of file +!.vscode/extensions.json + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..5dd357d4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:16 as builder + +WORKDIR /user/app +COPY package.json ./ +RUN npm install +COPY ./ ./ +RUN npm run build + +FROM node:16 + +WORKDIR /user/app +COPY package.json ./ +RUN npm install --only=production +COPY --from=builder /user/app/lib/ ./lib +ADD ./statics/ ./statics/ + +CMD ["bash", "-c", "npm run start"]