dockerfile-rails 1.5.9 → 1.5.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/dockerfile-rails/scanner.rb +1 -0
- data/lib/generators/dockerfile_generator.rb +15 -1
- data/lib/generators/templates/Dockerfile.erb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d88f0410567f5185fcffce4a01b85cd5d63d04864e261ded85f260389b1bbf35
|
4
|
+
data.tar.gz: 3f2d42a85d4b78401842aed0c78f277ae5d6c97fe8aa76a370a420d407b8ad5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf0c9e328c292f8e9f4cab6e5529ae0767837b0339cbd673809cd23aa6a884ff3fd7562e1a0d85fbe9711fb9925e60f1c3ecb9bf9f7b4ff9d6ad652dcab1b9d3
|
7
|
+
data.tar.gz: 9c1886019e9b95c8190beb66b82f65338f959b210ecced923aa819ec7843f903a849a8022b1429f92c6f0ab5ec20a0e62ef2e6bd05e1627e1e1cb3d79149afba
|
data/README.md
CHANGED
@@ -23,6 +23,10 @@ bin/rails generate dockerfile
|
|
23
23
|
### General option:
|
24
24
|
|
25
25
|
* `--force` - overwrite existing files
|
26
|
+
* `--skip` - keep existing files
|
27
|
+
|
28
|
+
If neither are specified, you will be prompted if a file exists with
|
29
|
+
different contents. If both are specified, `--force` takes precedence.
|
26
30
|
|
27
31
|
### Runtime Optimizations:
|
28
32
|
|
@@ -61,6 +65,7 @@ additional support may be needed:
|
|
61
65
|
* `--postgresql` - add postgresql libraries
|
62
66
|
* `--redis` - add redis libraries
|
63
67
|
* `--sqlite3` - add sqlite3 libraries
|
68
|
+
* `--sqlserver` - add SQL Server libraries
|
64
69
|
|
65
70
|
### Add a package/environment variable/build argument:
|
66
71
|
|
@@ -53,6 +53,7 @@ module DockerfileRails
|
|
53
53
|
@sqlite3 = true if @gemfile.include? "sqlite3"
|
54
54
|
@postgresql = true if @gemfile.include? "pg"
|
55
55
|
@mysql = true if @gemfile.include?("mysql2") || using_trilogy?
|
56
|
+
@sqlserver = true if @gemfile.include?("activerecord-sqlserver-adapter")
|
56
57
|
|
57
58
|
### node modules ###
|
58
59
|
|
@@ -35,6 +35,7 @@ class DockerfileGenerator < Rails::Generators::Base
|
|
35
35
|
"rollbar" => false,
|
36
36
|
"root" => false,
|
37
37
|
"sqlite3" => false,
|
38
|
+
"sqlserver" => false,
|
38
39
|
"sentry" => false,
|
39
40
|
"sudo" => false,
|
40
41
|
"swap" => nil,
|
@@ -127,6 +128,9 @@ class DockerfileGenerator < Rails::Generators::Base
|
|
127
128
|
class_option :sqlite3, aliases: "--sqlite", type: :boolean, default: OPTION_DEFAULTS.sqlite3,
|
128
129
|
desc: "include sqlite3 libraries"
|
129
130
|
|
131
|
+
class_option :sqlserver, aliases: "--sqlserver", type: :boolean, default: OPTION_DEFAULTS.sqlserver,
|
132
|
+
desc: "include SQL server libraries"
|
133
|
+
|
130
134
|
class_option :litefs, type: :boolean, default: OPTION_DEFAULTS.litefs,
|
131
135
|
desc: "replicate sqlite3 databases using litefs"
|
132
136
|
|
@@ -294,7 +298,7 @@ class DockerfileGenerator < Rails::Generators::Base
|
|
294
298
|
fly_attach_consul
|
295
299
|
end
|
296
300
|
|
297
|
-
if File.exist?("fly.toml") && (fly_processes || !options.prepare || options.swap)
|
301
|
+
if File.exist?("fly.toml") && (fly_processes || !options.prepare || options.swap || deploy_database == "sqlite3")
|
298
302
|
if File.stat("fly.toml").size > 0
|
299
303
|
template "fly.toml.erb", "fly.toml"
|
300
304
|
else
|
@@ -560,6 +564,7 @@ private
|
|
560
564
|
# add databases: sqlite3, postgres, mysql
|
561
565
|
packages << "pkg-config" if options.sqlite3? || @sqlite3
|
562
566
|
packages << "libpq-dev" if options.postgresql? || @postgresql
|
567
|
+
packages << "freetds-dev" if options.sqlserver? || @sqlserver
|
563
568
|
|
564
569
|
if (options.mysql? || @mysql) && !using_trilogy?
|
565
570
|
packages << "default-libmysqlclient-dev"
|
@@ -615,6 +620,7 @@ private
|
|
615
620
|
# start with databases: sqlite3, postgres, mysql
|
616
621
|
packages << "postgresql-client" if options.postgresql? || @postgresql
|
617
622
|
packages << "default-mysql-client" if options.mysql? || @mysql
|
623
|
+
packages << "freetds-bin" if options.sqlserver? || @sqlserver
|
618
624
|
packages << "libjemalloc2" if options.jemalloc? && !options.fullstaq?
|
619
625
|
if options.sqlite3? || @sqlite3
|
620
626
|
packages << "libsqlite3-0" unless packages.include? "sqlite3"
|
@@ -916,6 +922,8 @@ private
|
|
916
922
|
"postgresql"
|
917
923
|
elsif options.mysql? || @mysql || has_mysql_gem?
|
918
924
|
"mysql"
|
925
|
+
elsif options.sqlserver || @sqlserver
|
926
|
+
"sqlserver"
|
919
927
|
else
|
920
928
|
"sqlite3"
|
921
929
|
end
|
@@ -1147,6 +1155,12 @@ private
|
|
1147
1155
|
end
|
1148
1156
|
end
|
1149
1157
|
|
1158
|
+
if deploy_database == "sqlite3"
|
1159
|
+
if not toml.include? "[mounts]"
|
1160
|
+
toml += "[mounts]\n source=\"data\"\n destination=\"/data\"\n\n"
|
1161
|
+
end
|
1162
|
+
end
|
1163
|
+
|
1150
1164
|
if options.swap
|
1151
1165
|
suffixes = {
|
1152
1166
|
"kib" => 1024,
|
@@ -34,8 +34,8 @@ ENV <%= base_env.join(" \\\n ") %>
|
|
34
34
|
RUN gem update --system --no-document && \
|
35
35
|
gem install -N <%= base_gems.join(" ") %>
|
36
36
|
|
37
|
-
<% unless
|
38
|
-
# Install packages needed to install <%= base_requirements %>
|
37
|
+
<% unless base_packages.empty? -%>
|
38
|
+
# Install packages<% unless base_requirements.empty? -%> needed to install <%= base_requirements %><% end %>
|
39
39
|
<%= render partial: 'apt_install', locals: {packages: base_packages, clean: true, repos: base_repos} %>
|
40
40
|
|
41
41
|
<% end -%>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dockerfile-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.0.0
|
27
27
|
description:
|
28
28
|
email: rubys@intertwingly.net
|
29
29
|
executables: []
|