boxing 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 716a6100d6aa32b77aa0ec152655d305a218e69810171bc3e8b6884c90ddbba0
4
- data.tar.gz: 0a96c48d4cbbf0ecf5ce34e19955150576e2dca7b7a9841be40eb17f79c274bb
3
+ metadata.gz: 7aa77750bf2c795fb7a6ec267784bbd62c352a9803729c7ba53e2f00e8536867
4
+ data.tar.gz: ec949c8362198e86a3c93b9c7b90da42697e666a2f98e517614e15dafe2234b4
5
5
  SHA512:
6
- metadata.gz: 62c1a29292e5b511b57e58f4cf3d1659e16ffdb4da102f02dceb395a5d0bb77c73f2eeeafba8294a0ec57cc742bb18e6cc304b72b2032c97c0507cf19604597e
7
- data.tar.gz: a177892ab763e676074a8e38fdbcfedb961b0076f61d891d0089324062ab128335e336a8f63c0367d3a269a4be02c53749a1f4a74403db1362217bc622e1f9c2
6
+ metadata.gz: 883826c272959026f32ea98284def5e4908b96cf0866f3469bd934e464ffbe813a252b1fb29dc28c55c418e025c5ebf42c6b22cd21fa84da3d7687c2d72c0b11
7
+ data.tar.gz: 439823cf586f66dd4180570edbeda8089640c1ff80f7003524b8b34161c40d12ebaf7053dc432617fb3bf0db10844158c01484d17ccca127018b90bc27174603
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boxing (0.1.0)
4
+ boxing (0.1.1)
5
5
  bundler (~> 2.0)
6
6
  thor (~> 1.0)
7
7
 
data/README.md CHANGED
@@ -16,6 +16,46 @@ And then execute:
16
16
 
17
17
  $ bundle install
18
18
 
19
+ ## Features
20
+
21
+ ### Automatic Package Finder
22
+
23
+ This gem will read `Gemfile` and find any "knows" gem in the dependency database and put the necessary package as a dependency for build and runtime.
24
+
25
+ That means you never need to know the actual package and don't need to write your Dockerfile by hand.
26
+
27
+ ### Optimized Size
28
+
29
+ By the default, the base image is depend on `ruby:[VERSION]-alpine` which is minimal size for Ruby in most cases.
30
+
31
+ To let your image as small as possible, this gem uses multi-stage and strip useless artifacts while the c-extension compiling.
32
+
33
+ The final Rails image will be around 100MB and can be flexible to delivery to any environment.
34
+
35
+ > We suggest using `puma` as the webserver to avoid the extra dependency to keep the image small.
36
+
37
+ ### Revision
38
+
39
+ To identity your image version, the default build argument `REVISION` will be configured by default.
40
+
41
+ You can add extra options when you are building images in your CI.
42
+
43
+ ```yaml
44
+ # GitLab CI example
45
+ docker:rails:
46
+ extends: .docker
47
+ stage: package
48
+ script:
49
+ - docker build
50
+ --cache-from $RAILS_IMAGE:latest
51
+ --build-arg REVISION=${CI_COMMIT_SHORT_SHA}
52
+ --build-arg BUILDKIT_INLINE_CACHE=1
53
+ --tag $RAILS_IMAGE:$CI_COMMIT_REF_SLUG
54
+ --tag $RAILS_IMAGE:latest .
55
+ ```
56
+
57
+ It will helpful for Sentry to detect the released version or use `<%= ENV['REVISION'] %>` to help you identify the current version.
58
+
19
59
  ## Usage
20
60
 
21
61
  ### Generate
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Boxing
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
@@ -29,6 +29,9 @@ ARG APP_ROOT
29
29
  <%- if packages.select(&:runtime?).any? -%>
30
30
  RUN apk add --no-cache <%= packages.select(&:runtime?).join(' ') %>
31
31
 
32
+ ARG REVISION
33
+ ENV REVISION $REVISION
34
+
32
35
  <%- end -%>
33
36
  COPY --from=gem /usr/local/bundle/config /usr/local/bundle/config
34
37
  COPY --from=gem /usr/local/bundle /usr/local/bundle
@@ -43,6 +46,7 @@ ENV RAILS_LOG_TO_STDOUT=true
43
46
  ENV APP_ROOT=$APP_ROOT
44
47
 
45
48
  COPY . ${APP_ROOT}
49
+ RUN echo $REVISION > ${SERVER_ROOT}/REVISION
46
50
 
47
51
  # Apply Execute Permission
48
52
  RUN adduser -h ${APP_ROOT} -D -s /bin/nologin ruby ruby && \
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boxing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 蒼時弦也
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-18 00:00:00.000000000 Z
11
+ date: 2021-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler