railsdock 0.3.1 → 0.4.0

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: 22a989160e2cec44e7719ab7747a9e03e8366fda097786b1df6fb8de6c9ce288
4
- data.tar.gz: d353fb016c44b7075dc6c0ffe2f578444c06b58490b2d2a1b22abea3f5d06ef9
3
+ metadata.gz: 67c7ccaf161e8140b8f46ab84a668c483ad36b89e9ea0151ca1c142d99d8bca0
4
+ data.tar.gz: a693a9fa194faf80019f73e034ad026b8c2d441fa98066df35fa7b5d4296a847
5
5
  SHA512:
6
- metadata.gz: 0f81adc87738b5cee70579768dcd77c517a81d9e071735a899de6d6a92432f7908d938305d4fe7f2eb43d8fbf06ac7ea5f4dd4beaf40f1202bcbf36041f1cd0a
7
- data.tar.gz: 98e77abb93aaac1aa7ae519d241a92a340c2fe8f988159cadd5ca6341028ce4e8cc56a3c96d0e3dc96b65e9c2698f66e65eb44e9cfc5dcfe4ee9fa4343b61c8f
6
+ metadata.gz: 904b9176b2d00d1d52f29a819f40da561daf3ea106f51e37bdd2466708a317477d232c7bd37ad07b050479baa06a8ad52ae85ad591c36cce194a6a6f4d677117
7
+ data.tar.gz: 1be2282f4a931a2cc809102809fac6e1be4facf864f0871cc7cf94fcd8e4abd90c947fb9c8e69e84beead0ce1b348bdadc2b0282318a29c894e711e6ce80fdd8
@@ -11,6 +11,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
11
11
  ### Fixed
12
12
  ### Security
13
13
 
14
+ ## [0.4.0] - 08-08-2020
15
+ ### Changed
16
+ - default to exposing only necessary ports [PR26](https://github.com/hintmedia/railsdock/pull/26)
17
+ - move most config to compose file [PR28](https://github.com/hintmedia/railsdock/pull/28)
18
+ ### Fixed
19
+ - handle new apps with no schema.rb or structure.sql [I22](https://github.com/hintmedia/railsdock/issues/22) [PR25](https://github.com/hintmedia/railsdock/pull/25)
20
+
14
21
  ## [0.3.1] - 07-20-2020
15
22
  ### Fixed
16
23
  - command in docker-compose template [PR21](https://github.com/hintmedia/railsdock/pull/21)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- railsdock (0.3.1)
4
+ railsdock (0.4.0)
5
5
  bundler (~> 2.0)
6
6
  pastel (~> 0.7.2)
7
7
  railties (>= 4.2, < 6.1)
@@ -44,7 +44,7 @@ GEM
44
44
  diff-lcs (1.3)
45
45
  equatable (0.6.1)
46
46
  erubi (1.9.0)
47
- i18n (1.8.4)
47
+ i18n (1.8.5)
48
48
  concurrent-ruby (~> 1.0)
49
49
  loofah (2.6.0)
50
50
  crass (~> 1.0.2)
@@ -94,7 +94,7 @@ GEM
94
94
  pg (1.2.3)
95
95
  puma (4.3.5)
96
96
  nio4r (~> 2.0)
97
- rack (2.2.2)
97
+ rack (2.2.3)
98
98
  rack-proxy (0.6.5)
99
99
  rack
100
100
  rack-test (1.1.0)
@@ -172,7 +172,7 @@ GEM
172
172
  semantic_range (>= 2.3.0)
173
173
  websocket-driver (0.7.1)
174
174
  websocket-extensions (>= 0.1.0)
175
- websocket-extensions (0.1.4)
175
+ websocket-extensions (0.1.5)
176
176
  zeitwerk (2.3.0)
177
177
 
178
178
  PLATFORMS
@@ -4177,9 +4177,9 @@ lodash.uniq@^4.5.0:
4177
4177
  integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
4178
4178
 
4179
4179
  lodash@^4.0.0, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.5, lodash@~4.17.10:
4180
- version "4.17.15"
4181
- resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
4182
- integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
4180
+ version "4.17.19"
4181
+ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
4182
+ integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
4183
4183
 
4184
4184
  loglevel@^1.6.8:
4185
4185
  version "1.6.8"
@@ -7588,9 +7588,9 @@ websocket-driver@>=0.5.1:
7588
7588
  websocket-extensions ">=0.1.1"
7589
7589
 
7590
7590
  websocket-extensions@>=0.1.1:
7591
- version "0.1.3"
7592
- resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29"
7593
- integrity sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==
7591
+ version "0.1.4"
7592
+ resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42"
7593
+ integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==
7594
7594
 
7595
7595
  which-module@^2.0.0:
7596
7596
  version "2.0.0"
@@ -54,7 +54,6 @@ module Railsdock
54
54
  inject_driver_config(service)
55
55
  append_erb_to_compose_file(service)
56
56
  file.inject_into_file('./docker-compose.yml', "\n #{service}:", after: "\nvolumes:")
57
- append_service_config_to_env(service)
58
57
  if type == :database
59
58
  copy_db_yml("#{BASE_TEMPLATE_DIR}/#{service}/database.yml.erb")
60
59
  inject_db_script_into_entrypoint(service)
@@ -129,12 +128,6 @@ module Railsdock
129
128
  file.inject_into_file('./docker-compose.yml', " - #{service}\n", after: "depends_on:\n")
130
129
  end
131
130
 
132
- def append_service_config_to_env(service)
133
- file.safe_append_to_file('./.env') do
134
- ::File.binread("#{BASE_TEMPLATE_DIR}/#{service}/#{service}.env")
135
- end
136
- end
137
-
138
131
  def prompt_for_dockerfile_directory
139
132
  prompt.ask('Where would you like your docker container configuration files to live?') do |q|
140
133
  q.default './docker/'
@@ -13,19 +13,7 @@ COMPOSE_PATH_SEPARATOR=<%= is_windows? ? ';' : ':' %>
13
13
  # Define the prefix of container names. This is useful when there are multiple projects using railsdock
14
14
  COMPOSE_PROJECT_NAME=<%= app_name %>
15
15
 
16
- ###############################################################################
17
- ######################### Containers Customization ############################
18
- ###############################################################################
19
-
20
-
21
- ### RUBY ######################################################################
22
- # Select a Ruby Version of the Ruby container. Accepted values: 2.2.x-2.7.x
16
+ ### User Configuration ######################################################
23
17
 
24
- RAILSDOCK_RUBY_VERSION=<%= ruby_version %>
25
- BUNDLE_JOBS=10
26
- BUNDLE_RETRY=3
27
- RAILS_SERVER_HOST_PORT=3000
28
18
  RUBY_UID=<%= uid %>
29
19
  RUBY_GID=<%= uid %>
30
- # Select a Node Version for the Ruby container. Accepted values: 8-13
31
- RAILSDOCK_NODE_VERSION=12
@@ -4,10 +4,10 @@ x-ruby: &ruby-base
4
4
  build:
5
5
  context: <%= dockerfile_dir %>ruby
6
6
  args:
7
- - RAILSDOCK_RUBY_VERSION=${RAILSDOCK_RUBY_VERSION}
8
- - RAILSDOCK_NODE_VERSION=${RAILSDOCK_NODE_VERSION}
9
- - RAILSDOCK_BUNDLE_JOBS=${BUNDLE_JOBS}
10
- - RAILSDOCK_BUNDLE_RETRY=${BUNDLE_RETRY}
7
+ - RAILSDOCK_RUBY_VERSION=<%= ruby_version %>
8
+ - RAILSDOCK_NODE_VERSION=12
9
+ - RAILSDOCK_BUNDLE_JOBS=10
10
+ - RAILSDOCK_BUNDLE_RETRY=3
11
11
  - RUBY_UID=${RUBY_UID}
12
12
  - RUBY_GID=${RUBY_GID}
13
13
  volumes:
@@ -36,4 +36,4 @@ services:
36
36
  command: bundle exec rails server -p 3000 -b '0.0.0.0'
37
37
  entrypoint: ./docker/ruby/entrypoint.sh
38
38
  ports:
39
- - "${RAILS_SERVER_HOST_PORT}:3000"
39
+ - "3000:3000"
@@ -13,6 +13,7 @@ function lock_setup { mkdir -p $APP_TEMP_PATH && touch $APP_SETUP_LOCK; }
13
13
  function unlock_setup { rm -rf $APP_SETUP_LOCK; }
14
14
  function wait_setup { echo "Waiting for app setup to finish..."; sleep $APP_SETUP_WAIT; }
15
15
  function check_host { ping -q -c1 $HOST_DOMAIN > /dev/null 2>&1; }
16
+ function schema_file_exists { [[ -e "db/schema.rb" || -e "db/structure.sql" ]]; }
16
17
 
17
18
  # 2: 'Unlock' the setup process if the script exits prematurely:
18
19
  trap unlock_setup HUP INT QUIT KILL TERM EXIT
@@ -41,9 +42,10 @@ then
41
42
 
42
43
  yarn install
43
44
  # 9: Setup the database if it doesn't
44
- if ! rake db:version
45
- then
46
- rake db:setup
45
+ if ! schema_file_exists; then
46
+ bundle exec rake db:create && bundle exec rake db:migrate
47
+ elif ! rake db:migrate 2> /dev/null; then
48
+ bundle exec rake db:setup
47
49
  fi
48
50
 
49
51
  # check if the docker host is running on mac or windows
@@ -4,8 +4,6 @@
4
4
  build:
5
5
  context: <%= dockerfile_dir %>memcached
6
6
  args:
7
- - MEMCACHED_VERSION=${MEMCACHED_VERSION}
8
- ports:
9
- - "${MEMCACHED_HOST_PORT}:11211"
7
+ - MEMCACHED_VERSION=1.5
10
8
  volumes:
11
9
  - memcached:/var/lib/memcached
@@ -4,10 +4,8 @@
4
4
  build:
5
5
  context: <%= dockerfile_dir %>mysql
6
6
  args:
7
- - MYSQL_VERSION=${MYSQL_VERSION}
7
+ - MYSQL_VERSION=5.7
8
8
  environment:
9
- - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
10
- ports:
11
- - "${MYSQL_HOST_PORT}:3306"
9
+ - MYSQL_ROOT_PASSWORD=Password1
12
10
  volumes:
13
11
  - mysql:/var/lib/mysql
@@ -4,10 +4,8 @@
4
4
  build:
5
5
  context: <%= dockerfile_dir %>postgres
6
6
  args:
7
- - POSTGRES_VERSION=${POSTGRES_VERSION}
7
+ - POSTGRES_VERSION=12
8
8
  environment:
9
9
  - POSTGRES_HOST_AUTH_METHOD=trust
10
- ports:
11
- - "${POSTGRES_HOST_PORT}:5432"
12
10
  volumes:
13
11
  - postgres:/var/lib/postgresql/data
@@ -4,8 +4,6 @@
4
4
  build:
5
5
  context: <%= dockerfile_dir %>redis
6
6
  args:
7
- - REDIS_VERSION=${REDIS_VERSION}
8
- ports:
9
- - "${REDIS_HOST_PORT}:6379"
7
+ - REDIS_VERSION=5
10
8
  volumes:
11
9
  - redis:/data
@@ -1,3 +1,3 @@
1
1
  module Railsdock
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.4.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railsdock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Boe
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-07-20 00:00:00.000000000 Z
12
+ date: 2020-08-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -317,18 +317,14 @@ files:
317
317
  - lib/railsdock/templates/install/default/entrypoint.sh
318
318
  - lib/railsdock/templates/install/memcached/Dockerfile
319
319
  - lib/railsdock/templates/install/memcached/docker-compose.yml.erb
320
- - lib/railsdock/templates/install/memcached/memcached.env
321
320
  - lib/railsdock/templates/install/mysql/Dockerfile
322
321
  - lib/railsdock/templates/install/mysql/database.yml.erb
323
322
  - lib/railsdock/templates/install/mysql/docker-compose.yml.erb
324
- - lib/railsdock/templates/install/mysql/mysql.env
325
323
  - lib/railsdock/templates/install/postgres/Dockerfile
326
324
  - lib/railsdock/templates/install/postgres/database.yml.erb
327
325
  - lib/railsdock/templates/install/postgres/docker-compose.yml.erb
328
- - lib/railsdock/templates/install/postgres/postgres.env
329
326
  - lib/railsdock/templates/install/redis/Dockerfile
330
327
  - lib/railsdock/templates/install/redis/docker-compose.yml.erb
331
- - lib/railsdock/templates/install/redis/redis.env
332
328
  - lib/railsdock/version.rb
333
329
  - railsdock.gemspec
334
330
  - railsdock.png