vps 0.2.1 → 0.2.2
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/vps/cli/upstream.rb +1 -4
- data/lib/vps/version.rb +1 -1
- data/templates/docker/docker-compose.yml.erb +2 -1
- data/templates/docker/upstream/Dockerfile.node.erb +3 -0
- data/templates/docker/upstream/Dockerfile.phoenix.erb +3 -0
- data/templates/docker/upstream/Dockerfile.plug.erb +3 -0
- data/templates/docker/upstream/Dockerfile.rack.erb +3 -0
- data/templates/docker/upstream/Dockerfile.rails.erb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 495b59ec7e4efd137d87d03d2d5592512849879f
|
4
|
+
data.tar.gz: d9bf0c254e4e532e051a892096ba8cbdfbedda3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbc9e798ff049bcef6ca15750ca26a9fb6d015706068628118381d2a8702f1a041f7a6d55d0d2145a1e8de52c640e19f8d48e9eaf522a62d8714e22a518e1ad7
|
7
|
+
data.tar.gz: b52f3f9474ef1cc806bcf2fd14be10951641347a439016be2386e5d39c2c18c4575feabea7f4f4ab2042c87cebcf894a77f716daece7ed25fa77093d4edf46d5
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
## VPS CHANGELOG
|
2
2
|
|
3
|
+
### Version 0.2.2 (January 2, 2020)
|
4
|
+
|
5
|
+
* Automatically add container names for upstreams and services
|
6
|
+
* Add opportunity to add lines to the generated Dockerfile
|
7
|
+
|
3
8
|
### Version 0.2.1 (January 2, 2020)
|
4
9
|
|
5
10
|
* Support NodeJS based applications
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/lib/vps/cli/upstream.rb
CHANGED
@@ -12,10 +12,7 @@ module VPS
|
|
12
12
|
spec = derive_upstream(path)
|
13
13
|
config[:upstreams].push(spec.merge({
|
14
14
|
:name => name || File.basename(path),
|
15
|
-
:path => path
|
16
|
-
:compose => {
|
17
|
-
:container_name => name || File.basename(path)
|
18
|
-
}
|
15
|
+
:path => path
|
19
16
|
}))
|
20
17
|
VPS.write_config(host, config)
|
21
18
|
end
|
data/lib/vps/version.rb
CHANGED
@@ -34,12 +34,13 @@ services:
|
|
34
34
|
<%- services.to_h.each do |name, spec| %>
|
35
35
|
|
36
36
|
<%= name %>:
|
37
|
-
<%= OpenStruct.to_hash(spec).to_yaml.sub(/^.*?\n/, "").indent(4) %>
|
37
|
+
<%= OpenStruct.to_hash(spec).to_yaml.sub(/^.*?\n/, "").sub("\n", "\ncontainer_name: #{name}\n").indent(4) %>
|
38
38
|
<%- end %>
|
39
39
|
<%- upstreams.each do |upstream| %>
|
40
40
|
|
41
41
|
<%= upstream.name %>:
|
42
42
|
image: <%= upstream.name %>
|
43
|
+
container_name: <%= upstream.name %>
|
43
44
|
restart: always
|
44
45
|
<%- unless upstream[:compose].inspect.match(/\bports\b/) %>
|
45
46
|
ports:
|
@@ -11,6 +11,9 @@ WORKDIR /opt/app
|
|
11
11
|
COPY . .
|
12
12
|
|
13
13
|
ENV RACK_ENV=production
|
14
|
+
<%- if upstream.dockerfile %>
|
15
|
+
<%= upstream.dockerfile.strip %>
|
16
|
+
<%- end %>
|
14
17
|
RUN gem install bundler -v <%= upstream.bundler_version %>
|
15
18
|
RUN bundle install --without development test
|
16
19
|
CMD ["bundle", "exec", "rackup", "config.ru", "-o", "0.0.0.0"]
|
@@ -10,8 +10,12 @@ RUN apk update \
|
|
10
10
|
WORKDIR /opt/app
|
11
11
|
COPY . .
|
12
12
|
|
13
|
-
ENV RAILS_ENV=production
|
14
13
|
EXPOSE <%= upstream.port %>
|
14
|
+
|
15
|
+
ENV RAILS_ENV=production
|
16
|
+
<%- if upstream.dockerfile %>
|
17
|
+
<%= upstream.dockerfile.strip %>
|
18
|
+
<%- end %>
|
15
19
|
RUN gem install bundler -v <%= upstream.bundler_version %>
|
16
20
|
RUN bundle install --without development test
|
17
21
|
CMD ["rm", "-f", "tmp/pids/server.pid"]
|