Skip to content

Commit 7385e43

Browse files
committed
chore(build): split dependencies into other stage
1 parent 3144bec commit 7385e43

File tree

2 files changed

+142
-2
lines changed

2 files changed

+142
-2
lines changed

Diff for: .dockerignore

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
## Visual Studio Code files:
2+
.vscode/*
3+
# !.vscode/settings.json
4+
# !.vscode/tasks.json
5+
# !.vscode/launch.json
6+
# !.vscode/extensions.json
7+
*.code-workspace
8+
9+
# Local History for Visual Studio Code
10+
.history/
11+
12+
## Node.js files:
13+
# Logs
14+
logs
15+
*.log
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*
19+
lerna-debug.log*
20+
.pnpm-debug.log*
21+
22+
# Diagnostic reports (https://nodejs.org/api/report.html)
23+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
24+
25+
# Runtime data
26+
pids
27+
*.pid
28+
*.seed
29+
*.pid.lock
30+
31+
# Directory for instrumented libs generated by jscoverage/JSCover
32+
lib-cov
33+
34+
# Coverage directory used by tools like istanbul
35+
coverage
36+
*.lcov
37+
38+
# nyc test coverage
39+
.nyc_output
40+
41+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
42+
.grunt
43+
44+
# Bower dependency directory (https://bower.io/)
45+
bower_components
46+
47+
# node-waf configuration
48+
.lock-wscript
49+
50+
# Compiled binary addons (https://nodejs.org/api/addons.html)
51+
build/Release
52+
53+
# Dependency directories
54+
node_modules/
55+
jspm_packages/
56+
57+
# Snowpack dependency directory (https://snowpack.dev/)
58+
web_modules/
59+
60+
# TypeScript cache
61+
*.tsbuildinfo
62+
63+
# Optional npm cache directory
64+
.npm
65+
66+
# Optional eslint cache
67+
.eslintcache
68+
69+
# Microbundle cache
70+
.rpt2_cache/
71+
.rts2_cache_cjs/
72+
.rts2_cache_es/
73+
.rts2_cache_umd/
74+
75+
# Optional REPL history
76+
.node_repl_history
77+
78+
# Output of 'npm pack'
79+
*.tgz
80+
81+
# Yarn Integrity file
82+
.yarn-integrity
83+
84+
# dotenv environment variables file
85+
.env
86+
.env.test
87+
.env.production
88+
89+
# parcel-bundler cache (https://parceljs.org/)
90+
.cache
91+
.parcel-cache
92+
93+
# Next.js build output
94+
.next
95+
out
96+
97+
# Nuxt.js build / generate output
98+
.nuxt
99+
dist
100+
101+
# Gatsby files
102+
.cache/
103+
# Comment in the public line in if your project uses Gatsby and not Next.js
104+
# https://nextjs.org/blog/next-9-1#public-directory-support
105+
# public
106+
107+
# vuepress build output
108+
.vuepress/dist
109+
110+
# Serverless directories
111+
.serverless/
112+
113+
# FuseBox cache
114+
.fusebox/
115+
116+
# DynamoDB Local files
117+
.dynamodb/
118+
119+
# TernJS port file
120+
.tern-port
121+
122+
# Stores VSCode versions used for testing VSCode extensions
123+
.vscode-test
124+
125+
# yarn v2
126+
.yarn/cache
127+
.yarn/unplugged
128+
.yarn/build-state.yml
129+
.yarn/install-state.gz
130+
.pnp.*

Diff for: Dockerfile

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
FROM node:16.14
1+
# Build layer template for an eventual TS migration
2+
FROM node:16.17.0-slim as builder
23
ENV NODE_ENV=production
34

45
# Set working directory
56
WORKDIR /app
67

78
# Install dependencies
89
COPY package.json package-lock.json ./
9-
RUN npm ci
10+
RUN npm ci --omit=dev
11+
12+
FROM node:16.17.0-slim
13+
ENV NODE_ENV=production
14+
15+
# Set working directory
16+
WORKDIR /app
17+
18+
# Copy dependencies
19+
COPY --from=builder /app/node_modules ./node_modules
1020

1121
# Copy bot files
1222
COPY . .

0 commit comments

Comments
 (0)