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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/boxing/config.rb +2 -1
- data/lib/boxing/context.rb +26 -0
- data/lib/boxing/version.rb +1 -1
- data/templates/Dockerfile.tt +16 -17
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc711842897fe99033eddd84096476da91f3e8978932f1b7e6ad81c92e58d6a8
|
4
|
+
data.tar.gz: aa5a956bdaefd0aad083eb1d953850692110c87ce1b7feebdd7a0bf9b1b0437b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ec68e4a79a4c7143c7cb5c627a066fcb358752e6d1a070f76da6ceda516ee4d3c684505bafeac107d3dd83b68bed3d24b4d44e9a489ce716a2832da89c3afea
|
7
|
+
data.tar.gz: afcafc86d6cd2bf263982da25245ba29eb97c9bc7957da8c2a3b01a72e03bef095c94060c565d79ace96cc62b0edec7e644315ea7128ceffc3791e6666751d86
|
data/Gemfile.lock
CHANGED
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)
|
data/lib/boxing/context.rb
CHANGED
@@ -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
|
data/lib/boxing/version.rb
CHANGED
data/templates/Dockerfile.tt
CHANGED
@@ -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
|
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=
|
40
|
-
COPY --from=
|
41
|
-
COPY --from=
|
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=
|
59
|
-
COPY --from=
|
60
|
-
COPY --from=
|
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
|
-
|
104
|
-
|
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.
|
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-
|
11
|
+
date: 2022-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|