Browse Source

Reduce container size with clean yarn (#3506)

* Reduce container size with clean yarn

* Merge trouble
Hinaloe 1 year ago
parent
commit
1e1d788757
2 changed files with 49 additions and 2 deletions
  1. 46
    0
      .yarnclean
  2. 3
    2
      Dockerfile

+ 46
- 0
.yarnclean View File

@@ -0,0 +1,46 @@
1
+# test directories
2
+__tests__
3
+test
4
+tests
5
+powered-test
6
+
7
+# asset directories
8
+docs
9
+doc
10
+website
11
+images
12
+# assets
13
+
14
+# examples
15
+example
16
+examples
17
+
18
+# code coverage directories
19
+coverage
20
+.nyc_output
21
+
22
+# build scripts
23
+Makefile
24
+Gulpfile.js
25
+Gruntfile.js
26
+
27
+# configs
28
+.tern-project
29
+.gitattributes
30
+.editorconfig
31
+.*ignore
32
+.eslintrc
33
+.jshintrc
34
+.flowconfig
35
+.documentup.json
36
+.yarn-metadata.json
37
+.*.yml
38
+*.yml
39
+
40
+# misc
41
+*.gz
42
+*.md
43
+
44
+# for specific ignore
45
+!.svgo.yml
46
+

+ 3
- 2
Dockerfile View File

@@ -60,11 +60,12 @@ RUN apk -U upgrade \
60 60
  && cd /mastodon \
61 61
  && rm -rf /tmp/* /var/cache/apk/*
62 62
 
63
-COPY Gemfile Gemfile.lock package.json yarn.lock /mastodon/
63
+COPY Gemfile Gemfile.lock package.json yarn.lock .yarnclean /mastodon/
64 64
 
65 65
 RUN bundle config build.nokogiri --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include \
66 66
  && bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without test development \
67
- && yarn --pure-lockfile
67
+ && yarn --pure-lockfile \
68
+ && yarn cache clean
68 69
 
69 70
 COPY . /mastodon
70 71