dockerfile-rails 1.0.7 → 1.0.9

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: bdeba5d0ed37dcc3153aeacdb439a1b43f24581f0503f64bb6c21ab1efaeb2e6
4
- data.tar.gz: ea2818e2996d68abb56c7ccd8edb50647bcdf17a27012b4438014a266f4b98ef
3
+ metadata.gz: 7480e08de802e1158cee8c4328191fd924ccadc99ecb5183dfdd7d2a671cc059
4
+ data.tar.gz: bd652cd97e31632508f25e9d9aebeddb11e6914353b506a2a8c782a7016e1939
5
5
  SHA512:
6
- metadata.gz: bd6911007a0945277da47cc4df5683a55aeb0e6ab834ce37fdbc91bd17a1ec310ae25d00c0167089b70394ccd24e79762136020309105b4894751bfcd05d49dc
7
- data.tar.gz: 7ff6b8d79e2992b87c8b8fbec8f11f787bfe56ab32d176157f5d4251b6a3b82e1c7f78f00af85a61770a865fd6e871c6441540b69baa49f216589049f2e338a0
6
+ metadata.gz: 8e1d60aed5267759f46473d793addbcea1ed2c6a762b704c645b25a03d591be90c9da969946373b608141cd6f5d5f876abd0e659a6fa188d7dc8e805413f23fa
7
+ data.tar.gz: 8fcf8f92f60d6f7ceb1a48fe0b19ddc9cffa6daf4a4cd7869dd1c0734476777eeb55ae112bd321b70394500ab9889d9e53bb3500bad3fa654603b527ea8825da
@@ -209,6 +209,12 @@ private
209
209
  # libicu63 in buster, libicu67 in bullseye, libiclu72 in bookworm...
210
210
  packages << "libicu-dev" if @gemfile.include? 'charlock_holmes'
211
211
 
212
+
213
+ if @gemfile.include? 'webp-ffi'
214
+ # https://github.com/le0pard/webp-ffi#requirements
215
+ packages += %w(libjpeg-dev libpng-dev libtiff-dev libwebp-dev)
216
+ end
217
+
212
218
  packages.sort.uniq
213
219
  end
214
220
 
@@ -388,18 +394,18 @@ private
388
394
  end
389
395
 
390
396
  def node_version
391
- if File.exist? '.node-version'
392
- IO.read('.node-version')[/\d+\.\d+\.\d+/]
393
- else
394
- version = nil
397
+ version = nil
395
398
 
396
- if File.exist? 'package.json'
397
- version = JSON.parse(IO.read('package.json')).dig("engines", "node")
398
- version = nil unless version =~ /\A(\d+\.)+(\d+|x)\z/
399
- end
399
+ if File.exist? '.node-version'
400
+ version = IO.read('.node-version')[/\d+\.\d+\.\d+/]
401
+ end
400
402
 
401
- version || `node --version`[/\d+\.\d+\.\d+/]
403
+ if !version and File.exist? 'package.json'
404
+ version = JSON.parse(IO.read('package.json')).dig("engines", "node")
405
+ version = nil unless version =~ /\A(\d+\.)+(\d+|x)\z/
402
406
  end
407
+
408
+ version || `node --version`[/\d+\.\d+\.\d+/]
403
409
  rescue
404
410
  "lts"
405
411
  end
@@ -0,0 +1,31 @@
1
+ # configure nginx
2
+ RUN sed -i 's/access_log\s.*;/access_log \/dev\/stdout main;/' /etc/nginx/nginx.conf && \
3
+ sed -i 's/error_log\s.*;/error_log \/dev\/stderr info;/' /etc/nginx/nginx.conf && \
4
+ sed -i "/access_log/i\ \n\tlog_format main '\$http_fly_client_ip - \$remote_user [\$time_local] "\$request" '\n\t'\$status \$body_bytes_sent \"\$http_referer\" \"\$http_user_agent\"';" /etc/nginx/nginx.conf
5
+
6
+ COPY <<-"EOF" /etc/nginx/sites-available/default
7
+ server {
8
+ listen 3000 default_server;
9
+ listen [::]:3000 default_server;
10
+ access_log /dev/stdout;
11
+
12
+ root /rails/public;
13
+
14
+ location /cable {
15
+ proxy_pass http://localhost:8082/cable;
16
+ proxy_http_version 1.1;
17
+ proxy_set_header Upgrade $http_upgrade;
18
+ proxy_set_header Connection "Upgrade";
19
+ proxy_set_header Host $host;
20
+ }
21
+
22
+ location / {
23
+ try_files $uri @backend;
24
+ }
25
+
26
+ location @backend {
27
+ proxy_pass http://localhost:3001;
28
+ proxy_set_header origin 'http://localhost:3000';
29
+ }
30
+ }
31
+ EOF
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.0.7
4
+ version: 1.0.9
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-02-03 00:00:00.000000000 Z
11
+ date: 2023-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -40,6 +40,7 @@ files:
40
40
  - lib/generators/templates/Dockerfile.erb
41
41
  - lib/generators/templates/_apt_install.erb
42
42
  - lib/generators/templates/_install_node.erb
43
+ - lib/generators/templates/_nginx.erb
43
44
  - lib/generators/templates/_node_client.erb
44
45
  - lib/generators/templates/_npm_install.erb
45
46
  - lib/generators/templates/docker-compose.yml.erb