dip 4.1.0 → 4.2.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: 7ceb8c2f3312fdbc11a07bb73df3bb6c1a7a5bffbbab5b8adfd9a40585acb463
4
- data.tar.gz: 2f34aae2a69df0f8356245558f996f37ae459c72bd00136b39bd6bce63fc3977
3
+ metadata.gz: de28bb80ddff1548082c5b8ccd0115bcd650cbdba9a930c666b02751cf0ba976
4
+ data.tar.gz: 96a4a6d5b2f78b559ef429f793e1899ec8d35edc7f10ac90693632b8a9e2be06
5
5
  SHA512:
6
- metadata.gz: acd4d9ac91aadf4ea842350a3bcd2cf18c6ef05c55c6a659f2f32a822b03fa0effbde00e163ad8de9dc98e24dd5d0329320eb79f03b6b109cc6b318d07b1b928
7
- data.tar.gz: 3f0933d9bd9c482b733bb5672fd23b0def1fbfe6484166f759a017b6fc6beb5e20554b6de54a46009da8856894fbfbd0376cde2e3103426290205bcfe540965e
6
+ metadata.gz: 404af36fd19249124ab8bf8ce3f765c03f8e72ef9d6c1138424704233caf543c7ce2cf8ea7a86ece144407597bfba895cdb140ef277aa71042201a77221c974c
7
+ data.tar.gz: 4b788801e5c6e73e259f0de5b4c137aa5dcce5a7e681dae1d21b2c403118cdafdf0870c22bd80be350c25f943e100930c0f8296927898196e0c812e0f1f66254
data/README.md CHANGED
@@ -8,10 +8,15 @@ Docker Interaction Process
8
8
 
9
9
  A command-line utility that gives the "native" interaction with applications configured with Docker Compose. It is for local development only. In practice, it creates the feeling that you work without containers.
10
10
 
11
+ <p float="left">
12
+ <a href="https://evilmartians.com/?utm_source=dip"><img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" height="80" /></a>
13
+ <img src="https://ya-webdesign.com/images250_/vertical-divider-png-1.png" width="50" height="100" />
14
+ <a href="https://www.jetbrains.com/?from=DIP"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/JetBrains_Logo_2016.svg/1200px-JetBrains_Logo_2016.svg.png" alt="Sponsored by JetBrains" height="100" /></a></p>
15
+
11
16
  ## Presentations and examples
12
17
 
13
18
  - [Local development with Docker containers](https://slides.com/bibendi/dip)
14
- - [Dockerized Ruby on Rails application](https://github.com/bibendi/dip-example-rails)
19
+ - Dockerized Ruby on Rails applications: [one](https://github.com/bibendi/dip-example-rails), [two](https://github.com/evilmartians/evil_chat)
15
20
  - [Dockerized Node.js application](https://github.com/bibendi/yt-graphql-react-event-booking-api)
16
21
  - [Dockerized Ruby gem](https://github.com/bibendi/schked)
17
22
 
@@ -39,11 +44,11 @@ When we change the current directory, all shell aliases will be automatically re
39
44
 
40
45
  Also, in shell mode Dip is trying to determine manually passed environment variables. For example:
41
46
 
42
- ```sh
47
+ ```shhttps://ya-webdesign.com/images250_/vertical-divider-png-1.pnghttps://ya-webdesign.com/images250_/vertical-divider-png-1.png
43
48
  VERSION=20180515103400 rails db:migrate:down
44
49
  ```
45
50
 
46
- You could add this `eval` at the end of your `~/.zshrc`, or `~/.bashrc`, or `~/.bash_profile`.
51
+ You could add this `eval` at the end of your `~/.zshrc`, or `~/.bashrc`, or `~/.bash_profile`.
47
52
  After that, it will be automatically applied when you open your preferred terminal.
48
53
 
49
54
  ## Installation
@@ -70,14 +75,14 @@ gem install dip
70
75
 
71
76
  ### Precompiled binary
72
77
 
73
- If you don't have installed Ruby, then you could copy a precompiled binary to your system.
78
+ If you don't have installed Ruby, then you could copy a precompiled binary to your system.
74
79
  It can be found at [releases page](https://github.com/bibendi/dip/releases)
75
80
  or type bellow into your terminal:
76
81
 
77
82
  ```sh
78
- curl -L https://github.com/bibendi/dip/releases/download/4.1.0/dip-`uname -s`-`uname -m` > /usr/local/bin/dip
83
+ curl -L https://github.com/bibendi/dip/releases/download/4.2.0/dip-`uname -s`-`uname -m` > /usr/local/bin/dip
79
84
  chmod +x /usr/local/bin/dip
80
- ```
85
+ ```
81
86
 
82
87
  ## Docker installation
83
88
 
@@ -97,13 +102,13 @@ The configuration file `dip.yml` should be placed in a project root directory.
97
102
  Also, in some cases, you may want to change the default config path by providing an environment variable `DIP_FILE`.
98
103
  If nearby places `dip.override.yml` file it would be merged into the main config.
99
104
 
100
- Below is an example of a real config.
101
- `dip.yml` reference will be written soon.
105
+ Below is an example of a real config.
106
+ `dip.yml` reference will be written soon.
102
107
  Also, you can check out examples in the top.
103
108
 
104
109
  ```yml
105
110
  # Required minimum dip version
106
- version: '4'
111
+ version: '4.1'
107
112
 
108
113
  environment:
109
114
  COMPOSE_EXT: development
@@ -293,6 +298,20 @@ curl www.bar-app.docker/api/v1/quz
293
298
  curl www.bar-app.docker/api/v1/baz_service/qzz
294
299
  ```
295
300
 
301
+ #### Pass SSL certificates
302
+
303
+ ```sh
304
+ dip nginx up -c $HOME/ssl_certificates
305
+ ```
306
+
307
+ #### Publish more than one port to localhost
308
+
309
+ Just pass a list, separated by a space:
310
+
311
+ ```sh
312
+ dip nginx up -p 80:80 443:443
313
+ ```
314
+
296
315
  ### dip dns
297
316
 
298
317
  Runs a DNS server container based on https://github.com/aacebedo/dnsdock. It is used for container to container requests through Nginx. An application's docker-compose.yml should define `dns` configuration with environment variable `$DIP_DNS` and connect to external network `frontend`. `$DIP_DNS` will be automatically assigned by dip.
data/lib/dip/cli/nginx.rb CHANGED
@@ -16,12 +16,13 @@ module Dip
16
16
  desc: 'Path to docker socket'
17
17
  method_option :net, aliases: '-t', type: :string, default: "frontend",
18
18
  desc: 'Container network name'
19
- method_option :publish, aliases: '-p', type: :string, default: "80:80",
20
- desc: 'Container port'
19
+ method_option :publish, aliases: '-p', type: :array, default: "80:80",
20
+ desc: 'Container port(s). For more than one port, separate them by a space'
21
21
  method_option :image, aliases: '-i', type: :string, default: "bibendi/nginx-proxy:latest",
22
22
  desc: 'Docker image name'
23
23
  method_option :domain, aliases: '-d', type: :string, default: "docker",
24
24
  desc: 'Top level domain'
25
+ method_option :certs, aliases: '-c', type: :string, desc: 'Path to ssl certificates'
25
26
  def up
26
27
  if options[:help]
27
28
  invoke :help, ['up']
@@ -32,7 +33,8 @@ module Dip
32
33
  net: options.fetch(:net),
33
34
  publish: options.fetch(:publish),
34
35
  image: options.fetch(:image),
35
- domain: options.fetch(:domain)
36
+ domain: options.fetch(:domain),
37
+ certs: options[:certs]
36
38
  ).execute
37
39
  end
38
40
  end
@@ -7,13 +7,14 @@ module Dip
7
7
  module Commands
8
8
  module Nginx
9
9
  class Up < Dip::Command
10
- def initialize(name:, socket:, net:, publish:, image:, domain:)
10
+ def initialize(name:, socket:, net:, publish:, image:, domain:, certs:)
11
11
  @name = name
12
12
  @socket = socket
13
13
  @net = net
14
14
  @publish = publish
15
15
  @image = image
16
16
  @domain = domain
17
+ @certs = certs
17
18
  end
18
19
 
19
20
  def execute
@@ -26,8 +27,9 @@ module Dip
26
27
  def container_args
27
28
  result = %w(--detach)
28
29
  result << "--volume #{@socket}:/tmp/docker.sock:ro"
30
+ result << "--volume #{@certs}:/etc/nginx/certs" unless @certs.to_s.empty?
29
31
  result << "--restart always"
30
- result << "--publish #{@publish}"
32
+ result << Array(@publish).map { |p| "--publish #{p}" }.join(' ')
31
33
  result << "--net #{@net}"
32
34
  result << "--name #{@name}"
33
35
  result << "--label com.dnsdock.alias=#{@domain}"
data/lib/dip/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dip
4
- VERSION = "4.1.0"
4
+ VERSION = "4.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dip
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bibendi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-23 00:00:00.000000000 Z
11
+ date: 2019-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor