about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHinaloe <hina@hinaloe.net>2017-10-01 05:05:24 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-09-30 22:05:24 +0200
commit1e1d7887577ce5e2b1ceb0c1d08578ca173d5f5f (patch)
treee923216f035efc1c13ff1a2801afc43fd7f682d1
parent1df453aff6f46e1fddc665bffa3f68312f672956 (diff)
Reduce container size with clean yarn (#3506)
* Reduce container size with clean yarn

* Merge trouble
-rw-r--r--.yarnclean46
-rw-r--r--Dockerfile5
2 files changed, 49 insertions, 2 deletions
diff --git a/.yarnclean b/.yarnclean
new file mode 100644
index 000000000..f2de52869
--- /dev/null
+++ b/.yarnclean
@@ -0,0 +1,46 @@
+# test directories
+__tests__
+test
+tests
+powered-test
+
+# asset directories
+docs
+doc
+website
+images
+# assets
+
+# examples
+example
+examples
+
+# code coverage directories
+coverage
+.nyc_output
+
+# build scripts
+Makefile
+Gulpfile.js
+Gruntfile.js
+
+# configs
+.tern-project
+.gitattributes
+.editorconfig
+.*ignore
+.eslintrc
+.jshintrc
+.flowconfig
+.documentup.json
+.yarn-metadata.json
+.*.yml
+*.yml
+
+# misc
+*.gz
+*.md
+
+# for specific ignore
+!.svgo.yml
+
diff --git a/Dockerfile b/Dockerfile
index 431ef5bbe..c3b38fa8b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -60,11 +60,12 @@ RUN apk -U upgrade \
  && cd /mastodon \
  && rm -rf /tmp/* /var/cache/apk/*
 
-COPY Gemfile Gemfile.lock package.json yarn.lock /mastodon/
+COPY Gemfile Gemfile.lock package.json yarn.lock .yarnclean /mastodon/
 
 RUN bundle config build.nokogiri --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include \
  && bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without test development \
- && yarn --pure-lockfile
+ && yarn --pure-lockfile \
+ && yarn cache clean
 
 COPY . /mastodon