dockerfile-rails 1.0.7 → 1.0.8

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: bdeba5d0ed37dcc3153aeacdb439a1b43f24581f0503f64bb6c21ab1efaeb2e6
4
- data.tar.gz: ea2818e2996d68abb56c7ccd8edb50647bcdf17a27012b4438014a266f4b98ef
3
+ metadata.gz: b2f3045de59d0f73629e9a4e8fde156434157a03efb44f2ea0e6ad635ea4de5a
4
+ data.tar.gz: a39d31017f8c73bd9235336c06d3a3ee79e5ec4b48b5b284ea163d5d101475f0
5
5
  SHA512:
6
- metadata.gz: bd6911007a0945277da47cc4df5683a55aeb0e6ab834ce37fdbc91bd17a1ec310ae25d00c0167089b70394ccd24e79762136020309105b4894751bfcd05d49dc
7
- data.tar.gz: 7ff6b8d79e2992b87c8b8fbec8f11f787bfe56ab32d176157f5d4251b6a3b82e1c7f78f00af85a61770a865fd6e871c6441540b69baa49f216589049f2e338a0
6
+ metadata.gz: 86d23b99ea73ec3189ca25668769a6f390b8a11d6efbfcd9812f24cd0170f9e01323d440d7ebdd2a42233c76707fd5c781e7697b939f3d0ba22272220c91e844
7
+ data.tar.gz: 97ac9c940d08683a6ce1c086112d76ace43c275c32604a64bf6974b353220ebaa783ab5665c1b2ceb3091b2ba56dc0ad5d2b70addf106be3fffdd2587abe2c75
@@ -388,18 +388,18 @@ private
388
388
  end
389
389
 
390
390
  def node_version
391
- if File.exist? '.node-version'
392
- IO.read('.node-version')[/\d+\.\d+\.\d+/]
393
- else
394
- version = nil
391
+ version = nil
395
392
 
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
393
+ if File.exist? '.node-version'
394
+ version = IO.read('.node-version')[/\d+\.\d+\.\d+/]
395
+ end
400
396
 
401
- version || `node --version`[/\d+\.\d+\.\d+/]
397
+ if !version and File.exist? 'package.json'
398
+ version = JSON.parse(IO.read('package.json')).dig("engines", "node")
399
+ version = nil unless version =~ /\A(\d+\.)+(\d+|x)\z/
402
400
  end
401
+
402
+ version || `node --version`[/\d+\.\d+\.\d+/]
403
403
  rescue
404
404
  "lts"
405
405
  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.8
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-05 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