소스 검색

Add experimental dev build stage

Andrew Swistak 6 년 전
부모
커밋
2c91ee0913
1개의 변경된 파일18개의 추가작업 그리고 0개의 파일을 삭제
  1. 18 0
      Dockerfile

+ 18 - 0
Dockerfile

@@ -34,6 +34,24 @@ RUN rails assets:precompile && \
 # Copy the docker configurations over
 COPY config/database.yml.docker config/database.yml
 
+################################################################################
+FROM base AS dev
+
+ENV RAILS_ENV=development
+
+# We want to include all of our dependencies, so grab what we have already
+COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
+COPY --from=builder /app/ /app/
+
+# Re-add items removed from the builder
+COPY app/assets/ /app/app/assets/
+COPY vendor/assets/ /app/vendor/assets/
+COPY spec/ /app/spec/
+
+# (Re)install the missing development dependencies
+RUN bundle install --jobs 4 --retry 5 --with development test && \
+      yarn install
+
 ################################################################################
 # We want a tiny image, so don't start from base
 FROM ruby:2.6.3-alpine AS prod