dockerize-stack 0.7.0 → 0.9.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 +4 -4
- data/lib/config.yml +12 -0
- data/lib/dockerize_stack.rb +36 -0
- data/lib/version.rb +1 -1
- data/templates/gatsby/Dockerfile.erb +23 -0
- data/templates/gatsby/nginx/conf.d/default.conf +28 -0
- data/templates/strapi/Dockerfile.erb +15 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4ee88763471616ff7586862dd9038b4605e559501f15315747cbd1843e75aef
|
4
|
+
data.tar.gz: 42b4818685634aef39c46d462d153ee544cb38f6a6b1909fcc96a584fa822bec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee4c9a7ecae5e9778eae231dff76220a7d46715b640e884743ed6cd3c6f5e4b68aa646bfb18253691e9d8274f8fc35d423a19167861e85616b25a328784a7381
|
7
|
+
data.tar.gz: 51e6987896ffe7d3eb6491751237c716ec3156be0685fa1cdac7e3902523b8db814156ca0026963e59846e9335d27497637684f5316dfa99601232a84f9d2f0f
|
data/lib/config.yml
CHANGED
@@ -54,3 +54,15 @@ react:
|
|
54
54
|
title: "Nodejs version (default 10.16.3):"
|
55
55
|
default: "10.16.3"
|
56
56
|
type: ask_with_default
|
57
|
+
gatsby:
|
58
|
+
questions:
|
59
|
+
- option: nodejs_version
|
60
|
+
title: "Nodejs version (default 10.17.0):"
|
61
|
+
default: "10.17.0"
|
62
|
+
type: ask_with_default
|
63
|
+
strapi:
|
64
|
+
questions:
|
65
|
+
- option: nodejs_version
|
66
|
+
title: "Nodejs version (default 10.17.0):"
|
67
|
+
default: "10.17.0"
|
68
|
+
type: ask_with_default
|
data/lib/dockerize_stack.rb
CHANGED
@@ -50,5 +50,41 @@ module DockerizeStack
|
|
50
50
|
end
|
51
51
|
render_template! '.dockerignore.erb'
|
52
52
|
end
|
53
|
+
|
54
|
+
option :template_folder, aliases: 't', desc: 'Template folder path'
|
55
|
+
option :output_folder, default: '.', aliases: 'o', desc: 'Output folder'
|
56
|
+
|
57
|
+
CONFIG[:gatsby][:questions].each do |question|
|
58
|
+
option question[:option], desc: question[:title]
|
59
|
+
end
|
60
|
+
|
61
|
+
desc 'gatsby', 'generate docker files for gatsby app'
|
62
|
+
def gatsby
|
63
|
+
@type = :gatsby
|
64
|
+
run(options, @type)
|
65
|
+
all_file_paths(@type).each do |file_path|
|
66
|
+
file_name = file_path.gsub("/templates/#{@type}", '')
|
67
|
+
template file_name, "#{@output_folder}/#{file_name.gsub('.erb', '')}"
|
68
|
+
end
|
69
|
+
render_template! '.dockerignore.erb'
|
70
|
+
end
|
71
|
+
|
72
|
+
option :template_folder, aliases: 't', desc: 'Template folder path'
|
73
|
+
option :output_folder, default: '.', aliases: 'o', desc: 'Output folder'
|
74
|
+
|
75
|
+
CONFIG[:strapi][:questions].each do |question|
|
76
|
+
option question[:option], desc: question[:title]
|
77
|
+
end
|
78
|
+
|
79
|
+
desc 'strapi', 'generate docker files for strapi app'
|
80
|
+
def strapi
|
81
|
+
@type = :strapi
|
82
|
+
run(options, @type)
|
83
|
+
all_file_paths(@type).each do |file_path|
|
84
|
+
file_name = file_path.gsub("/templates/#{@type}", '')
|
85
|
+
template file_name, "#{@output_folder}/#{file_name.gsub('.erb', '')}"
|
86
|
+
end
|
87
|
+
render_template! '.dockerignore.erb'
|
88
|
+
end
|
53
89
|
end
|
54
90
|
end
|
data/lib/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
# BUILD STAGE
|
2
|
+
FROM node:<%= @nodejs_version %>-slim as build
|
3
|
+
|
4
|
+
#RUN apk -u add git openssh
|
5
|
+
|
6
|
+
WORKDIR /app
|
7
|
+
COPY package.json package-lock.json ./
|
8
|
+
RUN npm ci
|
9
|
+
|
10
|
+
COPY . .
|
11
|
+
RUN npm run build
|
12
|
+
|
13
|
+
# FINAL STAGE
|
14
|
+
FROM nginx:1.15
|
15
|
+
WORKDIR /app
|
16
|
+
|
17
|
+
COPY --from=build /app/public /app/public
|
18
|
+
COPY ./nginx/conf.d/default.conf /app/default.conf
|
19
|
+
|
20
|
+
CMD /bin/bash -c "envsubst < /app/default.conf > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
|
21
|
+
|
22
|
+
# docker build -t gatsby-app .
|
23
|
+
# docker run --rm -e PORT=8080 -p 8080:8080 gatsby-app
|
@@ -0,0 +1,28 @@
|
|
1
|
+
server {
|
2
|
+
listen ${PORT};
|
3
|
+
server_name localhost;
|
4
|
+
|
5
|
+
#charset koi8-r;
|
6
|
+
#access_log /var/log/nginx/host.access.log main;
|
7
|
+
|
8
|
+
location / {
|
9
|
+
root /app/public;
|
10
|
+
index index.html index.htm;
|
11
|
+
}
|
12
|
+
|
13
|
+
#error_page 404 /404.html;
|
14
|
+
|
15
|
+
# redirect server error pages to the static page /50x.html
|
16
|
+
#
|
17
|
+
error_page 500 502 503 504 /50x.html;
|
18
|
+
location = /50x.html {
|
19
|
+
root /usr/share/nginx/html;
|
20
|
+
}
|
21
|
+
|
22
|
+
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
|
23
|
+
#
|
24
|
+
#location ~ \.php$ {
|
25
|
+
# proxy_pass http://127.0.0.1;
|
26
|
+
#}
|
27
|
+
|
28
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# BUILD STAGE
|
2
|
+
FROM node:<%= @nodejs_version %>-alpine as build
|
3
|
+
|
4
|
+
# production setup
|
5
|
+
# ENV NODE_ENV=production
|
6
|
+
WORKDIR /app
|
7
|
+
COPY package.json package-lock.json ./
|
8
|
+
RUN npm ci
|
9
|
+
|
10
|
+
COPY . .
|
11
|
+
RUN npm run build
|
12
|
+
|
13
|
+
CMD ["npx","strapi", "develop"]
|
14
|
+
# production setup
|
15
|
+
# CMD ["npx","strapi", "start"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dockerize-stack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Savignano
|
@@ -39,6 +39,8 @@ files:
|
|
39
39
|
- lib/dockerize_stack.rb
|
40
40
|
- lib/thor_extend.rb
|
41
41
|
- lib/version.rb
|
42
|
+
- templates/gatsby/Dockerfile.erb
|
43
|
+
- templates/gatsby/nginx/conf.d/default.conf
|
42
44
|
- templates/rails/Dockerfile.erb
|
43
45
|
- templates/rails/config/database-docker.yml.erb
|
44
46
|
- templates/rails/docker-compose.yml.erb
|
@@ -60,6 +62,7 @@ files:
|
|
60
62
|
- templates/rails/nginx/etc/nginx/nginx.conf
|
61
63
|
- templates/react/Dockerfile.erb
|
62
64
|
- templates/react/nginx/conf.d/default.conf.template
|
65
|
+
- templates/strapi/Dockerfile.erb
|
63
66
|
homepage: https://github.com/MiguelSavignano/dockerize-stack
|
64
67
|
licenses:
|
65
68
|
- MIT
|