boxing 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab97ea8a0276e762c9cd0f5736f19175fd233d4f552462c8fb1faadc8a121086
4
- data.tar.gz: c5224a0d0ca31c95dff6b1ab6a021951f226acc935e8db4c7b73ea4154dd49b1
3
+ metadata.gz: cc711842897fe99033eddd84096476da91f3e8978932f1b7e6ad81c92e58d6a8
4
+ data.tar.gz: aa5a956bdaefd0aad083eb1d953850692110c87ce1b7feebdd7a0bf9b1b0437b
5
5
  SHA512:
6
- metadata.gz: 737444f78fcd82b5db9a7613e36756ade56cef14d479ed9e60465a68c48a1402fb301de6111174ba0ad6f2e4d1aa3ae12e56f6470569d8f81bf65eda0de498ff
7
- data.tar.gz: abec7450d007e6eba5dd33b682c6bee3ef2b3d88ea7d28443af281305c9b46258f71c1ab75ee473bfc464e00678a22236a3b1440b93641b70eec50e1d2a7e70e
6
+ metadata.gz: 4ec68e4a79a4c7143c7cb5c627a066fcb358752e6d1a070f76da6ceda516ee4d3c684505bafeac107d3dd83b68bed3d24b4d44e9a489ce716a2832da89c3afea
7
+ data.tar.gz: afcafc86d6cd2bf263982da25245ba29eb97c9bc7957da8c2a3b01a72e03bef095c94060c565d79ace96cc62b0edec7e644315ea7128ceffc3791e6666751d86
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boxing (0.8.0)
4
+ boxing (0.9.0)
5
5
  bundler (~> 2.0)
6
6
  thor (~> 1.0)
7
7
 
data/lib/boxing/config.rb CHANGED
@@ -13,7 +13,8 @@ module Boxing
13
13
  :health_check, :health_check_path,
14
14
  :assets_precompile, :node_version,
15
15
  :build_packages, :runtime_packages,
16
- :revision, :sentry_release
16
+ :revision, :sentry_release,
17
+ :entrypoint, :command
17
18
 
18
19
  # @since 0.5.0
19
20
  def initialize(&block)
@@ -115,5 +115,31 @@ module Boxing
115
115
  mode |= Package::RUNTIME if config.runtime_packages&.include?(name)
116
116
  mode
117
117
  end
118
+
119
+ # Return entrypoint options
120
+ #
121
+ # @return [Array<String>]
122
+ #
123
+ # @since 0.9.0
124
+ def entrypoint
125
+ return config.entrypoint.map(&:to_s) if config.entrypoint
126
+ return ['bin/openbox'] if has?('openbox')
127
+ return ['bin/rails'] if has?('rails')
128
+
129
+ %w[bundle exec]
130
+ end
131
+
132
+ # Return command options
133
+ #
134
+ # @return [Array<String>]
135
+ #
136
+ # @since 0.9.0
137
+ def command
138
+ return config.command.map(&:to_s) if config.command
139
+ return ['server'] if has?('openbox')
140
+ return ['server', '-b', '0.0.0.0'] if has?('rails')
141
+
142
+ ['rackup', '-o', '0.0.0.0']
143
+ end
118
144
  end
119
145
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Boxing
4
- VERSION = '0.8.0'
4
+ VERSION = '0.9.0'
5
5
  end
@@ -2,7 +2,7 @@ ARG APP_ROOT=<%= config.root %>
2
2
  ARG RUBY_VERSION=<%= RUBY_VERSION %>
3
3
  <%- if config.assets_precompile -%>ARG NODE_VERSION=<%= node_version %><%- end -%>
4
4
 
5
- FROM ruby:${RUBY_VERSION}-alpine AS gem
5
+ FROM ruby:${RUBY_VERSION}-alpine AS base
6
6
  ARG APP_ROOT
7
7
 
8
8
  RUN apk add --no-cache <%= packages.select(&:build?).join(' ') %>
@@ -22,6 +22,10 @@ RUN gem install bundler:<%= Bundler::VERSION %> \
22
22
  && find ${APP_ROOT}/vendor/bundle -type f -name '*.o' -delete \
23
23
  && find ${APP_ROOT}/vendor/bundle -type f -name '*.gem' -delete
24
24
 
25
+ <%- if has?('bootsnap') -%>
26
+ RUN bundle exec bootsnap precompile --gemfile app/ lib/
27
+
28
+ <%- end -%>
25
29
  <%- if config.assets_precompile -%>
26
30
  FROM node:${NODE_VERSION}-alpine as node
27
31
  FROM ruby:${RUBY_VERSION}-alpine as assets
@@ -36,9 +40,9 @@ RUN apk add --no-cache <%= packages.select(&:runtime?).join(' ') %> yarn
36
40
  <%- end -%>
37
41
  COPY --from=node /usr/local/bin/node /usr/local/bin/node
38
42
 
39
- COPY --from=gem /usr/local/bundle/config /usr/local/bundle/config
40
- COPY --from=gem /usr/local/bundle /usr/local/bundle
41
- COPY --from=gem ${APP_ROOT}/vendor/bundle ${APP_ROOT}/vendor/bundle
43
+ COPY --from=base /usr/local/bundle/config /usr/local/bundle/config
44
+ COPY --from=base /usr/local/bundle /usr/local/bundle
45
+ COPY --from=base ${APP_ROOT}/vendor/bundle ${APP_ROOT}/vendor/bundle
42
46
 
43
47
  RUN mkdir -p ${APP_ROOT}
44
48
  COPY . ${APP_ROOT}
@@ -55,10 +59,13 @@ ARG APP_ROOT
55
59
  RUN apk add --no-cache <%= packages.select(&:runtime?).join(' ') %>
56
60
 
57
61
  <%- end -%>
58
- COPY --from=gem /usr/local/bundle/config /usr/local/bundle/config
59
- COPY --from=gem /usr/local/bundle /usr/local/bundle
60
- COPY --from=gem ${APP_ROOT}/vendor/bundle ${APP_ROOT}/vendor/bundle
62
+ COPY --from=base /usr/local/bundle/config /usr/local/bundle/config
63
+ COPY --from=base /usr/local/bundle /usr/local/bundle
64
+ COPY --from=base ${APP_ROOT}/vendor/bundle ${APP_ROOT}/vendor/bundle
65
+ <%- if has?('bootsnap') -%>
66
+ COPY --from=base ${APP_ROOT}/tmp/cache ${APP_ROOT}/tmp/cache
61
67
 
68
+ <%- end -%>
62
69
  RUN mkdir -p ${APP_ROOT}
63
70
 
64
71
  <%- if has?('rails') -%>
@@ -100,13 +107,5 @@ EXPOSE <%= config.port %>
100
107
  <%- if has?('liveness') || config.health_check -%>
101
108
  HEALTHCHECK CMD curl -f http://localhost:<%= config.port %><%= config.health_check_path %> || exit 1
102
109
  <%- end -%>
103
- <%- if has?('openbox') -%>
104
- ENTRYPOINT ["bin/openbox"]
105
- CMD ["server"]
106
- <%- elsif has?('rails') -%>
107
- ENTRYPOINT ["bin/rails"]
108
- CMD ["server", "-b", "0.0.0.0"]
109
- <%- else -%>
110
- ENTRYPOINT ["bundle", "exec"]
111
- CMD ["rackup", "-o", "0.0.0.0"]
112
- <%- end -%>
110
+ ENTRYPOINT <%= entrypoint %>
111
+ CMD <%= command %>
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.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - 蒼時弦也
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-31 00:00:00.000000000 Z
11
+ date: 2022-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler