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 +4 -4
- data/lib/generators/dockerfile_generator.rb +9 -9
- data/lib/generators/templates/_nginx.erb +31 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2f3045de59d0f73629e9a4e8fde156434157a03efb44f2ea0e6ad635ea4de5a
|
4
|
+
data.tar.gz: a39d31017f8c73bd9235336c06d3a3ee79e5ec4b48b5b284ea163d5d101475f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
392
|
-
IO.read('.node-version')[/\d+\.\d+\.\d+/]
|
393
|
-
else
|
394
|
-
version = nil
|
391
|
+
version = nil
|
395
392
|
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
end
|
393
|
+
if File.exist? '.node-version'
|
394
|
+
version = IO.read('.node-version')[/\d+\.\d+\.\d+/]
|
395
|
+
end
|
400
396
|
|
401
|
-
|
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.
|
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-
|
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
|