From a2637c17200f9dd2eea9e130368cea87076823c7 Mon Sep 17 00:00:00 2001 From: Ryan Wade Date: Thu, 6 Apr 2017 15:41:00 +0800 Subject: Optimize Dockerfile Optimize Dockerfile, reduce build time. --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index bcc911343..f5eb08893 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ENV RAILS_ENV=production \ WORKDIR /mastodon -COPY . /mastodon +COPY Gemfile Gemfile.lock package.json yarn.lock /mastodon/ RUN BUILD_DEPS=" \ postgresql-dev \ @@ -28,4 +28,6 @@ RUN BUILD_DEPS=" \ && apk del $BUILD_DEPS \ && rm -rf /tmp/* /var/cache/apk/* +COPY . /mastodon + VOLUME /mastodon/public/system /mastodon/public/assets -- cgit From a3318814e10d94fcbb1c3f717f5b0064c49c30c7 Mon Sep 17 00:00:00 2001 From: Wonderfall Date: Thu, 6 Apr 2017 20:57:16 +0200 Subject: add metadata to Dockerfile --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index f5eb08893..c28287cca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,13 @@ FROM ruby:2.3.1-alpine +LABEL maintainer="https://github.com/tootsuite/mastodon" \ + description="A GNU Social-compatible microblogging server" + ENV RAILS_ENV=production \ NODE_ENV=production +EXPOSE 3000 4000 + WORKDIR /mastodon COPY Gemfile Gemfile.lock package.json yarn.lock /mastodon/ -- cgit From 12f1cdeed1dcc328efc09eb0e9fe358f6bff1b8e Mon Sep 17 00:00:00 2001 From: Florian Maunier Date: Fri, 7 Apr 2017 13:31:18 +0200 Subject: Fix npm/yarn cache cleaning --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index c28287cca..57a8f34e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,8 @@ RUN BUILD_DEPS=" \ && npm install -g npm@3 && npm install -g yarn \ && bundle install --deployment --without test development \ && yarn \ - && npm cache clean \ + && yarn cache clean \ + && npm -g cache clean \ && apk del $BUILD_DEPS \ && rm -rf /tmp/* /var/cache/apk/* -- cgit