error_agency-docker 0.1.1 → 0.1.2

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: 146cbf7bba5c79e41d2fdda9e3c2efc1cd226e88f159f2f1bd1cd8f1fa6db713
4
- data.tar.gz: bde0db5db3ff2b473237dec4e025f87676579819c7601de97a8564da7259b152
3
+ metadata.gz: bfb0fe7d267cae27ff1383d9e116a8d2b387c69d0e48507047631971912f9eac
4
+ data.tar.gz: f16622327cb13003336240a134e7175269d768b147bf9a85b8574eaee4194809
5
5
  SHA512:
6
- metadata.gz: 3bc7ec732f4b6bf96be79d4ffa798a3bc4267d9a9ef4603f7089984a6eeb8f522f09d6b7b36549dc6a73b52dcee28296f03d34f6f29ca51e0020565215ef7b3e
7
- data.tar.gz: 985205d0d056912ceb5769a1f7232b3d02ec42b493260694f96721bdb7ad2533353e8cedcf78d449b016f598961b727e56eb036af1239d97977089d79b18d62c
6
+ metadata.gz: 465ec3d861ebbad5103335dd58b945dc820db359ac2b6169356f5d94049e47e478f2edfa533461617d1e56045d63576eb577d775859a1d16f8f30bdab1d6dd38
7
+ data.tar.gz: 04056b72eb7edf9ecc810c6bd9cc03941b3ca2343ff525f6159e47d7daf737873a938c95cda90c595194ede98f3dd6c17010ae160de18b9de13d10ea79e4ac67
@@ -1,5 +1,5 @@
1
1
  module ErrorAgency
2
2
  module Docker
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -11,7 +11,7 @@ module ErrorAgency
11
11
  class_option :redis, type: :boolean, desc: "Generate docker configs for Redis. Installs by default.", default: true
12
12
  class_option :mailhog, type: :boolean, desc: "Generate docker configs for Mailhog. Installed by default.", default: true
13
13
  class_option :elasticsearch, type: :boolean, desc: "Generate docker configs for Elasticsearch. NOT installed by default.", default: false
14
- class_option :headless_chrome, type: :boolean, desc: "Generate configs for headless Chrome. NOT installed by default."
14
+ class_option :headless_chrome, type: :boolean, desc: "Generate configs for headless Chrome. NOT installed by default.", default: false
15
15
  class_option :ruby_version, type: :string, desc: "Define the Ruby version to use", default: "2.6.5"
16
16
  class_option :elasticsearch_version, type: :string, desc: "Define the Elasticsearch version to use", default: "6.2.4"
17
17
  class_option :mysql_version, type: :string, desc: "Define the MySQL version to use", default: "5.6"
@@ -1,42 +1,103 @@
1
1
  version: '3.5'
2
2
 
3
+ x-volumes: &volumes
4
+ - .:/app:cached
5
+ - bundle:/bundle
6
+ - node_modules:/app/node_modules
7
+ - packs:/app/public/packs
8
+ - rails_cache:/app/tmp/cache
9
+ - ~/.ssh:/root/.ssh
10
+ - irb_history:/root/irb_history
11
+ - ./config/docker/rails_base/.irbrc:/root/.irbrc
12
+
3
13
  services:
4
14
  rails_base: &rails_base
15
+ volumes:
16
+ *volumes
5
17
  build:
6
18
  context: .
7
19
  dockerfile: ./config/docker/rails_base/Dockerfile
8
20
  tmpfs:
9
21
  - /tmp
10
- volumes:
11
- - .:/app:cached
12
- - bundle:/bundle
13
- - node_modules:/app/node_modules
14
- - packs:/app/public/packs
15
- - rails_cache:/app/tmp/cache
16
- - ~/.ssh:/root/.ssh
17
- - irb_history:/root/irb_history
18
- - ./config/docker/web/.irbrc:/root/.irbrc
19
- stdin_open: true
20
- tty: true
21
22
 
22
23
  web:
23
- <<: *rails_base
24
+ image: rails_base:latest
25
+ volumes:
26
+ *volumes
27
+ depends_on:
28
+ - mysql
29
+ - redis
30
+ - webpacker
24
31
  ports:
25
32
  - 3000:3000
26
33
  command: rails s -b 0.0.0.0
27
34
  environment:
28
35
  - WEBPACKER_DEV_SERVER_HOST=webpacker
36
+ stdin_open: true
37
+ tty: true
38
+ entrypoint: ./config/docker/web/entrypoint.sh
29
39
 
30
40
  webpacker:
31
- <<: *rails_base
41
+ image: rails_base:latest
42
+ volumes:
43
+ *volumes
44
+ depends_on:
45
+ - mysql
46
+ - redis
32
47
  ports:
33
48
  - 3035:3035
34
49
  command: ./bin/webpack-dev-server
35
50
  environment:
36
51
  - WEBPACKER_DEV_SERVER_HOST=0.0.0.0
37
52
 
53
+ <% if @headless_chrome %>
54
+ tests:
55
+ volumes:
56
+ *volumes
57
+ logging:
58
+ driver: none
59
+ ports:
60
+ - 5900:5900
61
+ build:
62
+ context: .
63
+ shm_size: 2g
64
+ dockerfile: ./config/docker/tests/Dockerfile
65
+ command: bash # run with `docker-compose run tests guard`
66
+ environment:
67
+ - RAILS_ENV=test
68
+ - WEBPACKER_DEV_SERVER_HOST=0.0.0.0
69
+ <% end %>
70
+
71
+ <% if @elasticsearch %>
72
+ elasticsearch:
73
+ build:
74
+ context: .
75
+ dockerfile: ./config/docker/elasticsearch/Dockerfile
76
+ ports:
77
+ - "9200:9200"
78
+ - "8080:8080"
79
+ environment:
80
+ # LOGSPOUT: 'ignore'
81
+ # ES_JAVA_OPTS: '-Xms1024m -Xmx1024m'
82
+ # bootstrap.memory_lock: 'false'
83
+ discovery.type: 'single-node'
84
+ # ulimits:
85
+ # memlock:
86
+ # soft: -1
87
+ # hard: -1
88
+ # nofile:
89
+ # soft: 262144
90
+ # hard: 262144
91
+ volumes:
92
+ - es_data:/usr/share/elasticsearch/data
93
+ <% end %>
94
+
95
+
96
+
38
97
  shell:
39
- <<: *rails_base
98
+ image: rails_base:latest
99
+ volumes:
100
+ *volumes
40
101
  command: bash
41
102
 
42
103
  <% if @mysql %>
@@ -62,6 +123,7 @@ services:
62
123
  ports:
63
124
  - 6379:6379
64
125
  <% end %>
126
+
65
127
  <% if @mailhog %>
66
128
  mailhog:
67
129
  command: ["-smtp-bind-addr", "0.0.0.0:2525"]
@@ -71,47 +133,6 @@ services:
71
133
  - 2525:2525
72
134
  - 8025:8025
73
135
  <% end %>
74
-
75
- <% if @elasticsearch %>
76
- elasticsearch:
77
- build:
78
- context: .
79
- dockerfile: ./config/docker/elasticsearch/Dockerfile
80
- ports:
81
- - "9200:9200"
82
- - "8080:8080"
83
- environment:
84
- # LOGSPOUT: 'ignore'
85
- # ES_JAVA_OPTS: '-Xms1024m -Xmx1024m'
86
- # bootstrap.memory_lock: 'false'
87
- discovery.type: 'single-node'
88
- # ulimits:
89
- # memlock:
90
- # soft: -1
91
- # hard: -1
92
- # nofile:
93
- # soft: 262144
94
- # hard: 262144
95
- volumes:
96
- - es_data:/usr/share/elasticsearch/data
97
- healthcheck:
98
- test: ["CMD", "curl", "-SsfL", "127.0.0.1:9200/_cat/health?h=status"]
99
- interval: 10s
100
- timeout: 1s
101
- retries: 10
102
- <% end %>
103
-
104
- <% if @headless_chrome %>
105
- chrome:
106
- logging:
107
- driver: none
108
- ports:
109
- - 5900:5900
110
- build:
111
- context: .
112
- shm_size: 2g
113
- dockerfile: ./config/docker/chrome/Dockerfile
114
- <% end %>
115
136
  volumes:
116
137
  bundle:
117
138
  node_modules:
@@ -120,3 +141,5 @@ volumes:
120
141
  db_data:
121
142
  irb_history:
122
143
  <% if @elasticsearch %>es_data:<% end %>
144
+
145
+
@@ -0,0 +1,15 @@
1
+ [mysqld]
2
+ innodb_buffer_pool_size = 256M
3
+ innodb_file_per_table= 1
4
+ # Set the innodb file format to Barracuda
5
+ innodb_file_format = Barracuda
6
+ # Set large prefix on
7
+ innodb_large_prefix = 1
8
+ init_connect='SET collation_connection = utf8mb4_unicode_ci'
9
+ init_connect='SET NAMES utf8mb4'
10
+ innodb_file_format_max = Barracuda
11
+ innodb_strict_mode = 1
12
+ character_set_server = 'utf8mb4'
13
+ collation_server = 'utf8mb4_unicode_ci'
14
+ innodb_log_file_size = 50G
15
+ max_allowed_packet = 1073741824
@@ -13,8 +13,6 @@ RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources
13
13
 
14
14
  RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends nodejs yarn
15
15
 
16
- RUN gem update --system && gem install bundler -v '2'
17
-
18
16
  # Configure bundler and PATH
19
17
  ENV LANG=C.UTF-8 \
20
18
  GEM_HOME=/bundle \
@@ -25,7 +23,9 @@ ENV BUNDLE_APP_CONFIG=$BUNDLE_PATH \
25
23
  BUNDLE_BIN=$BUNDLE_PATH/bin
26
24
  ENV PATH /app/bin:$BUNDLE_BIN:$PATH
27
25
 
26
+ RUN gem update --system && gem install bundler -v 2.0.2
27
+
28
28
  RUN mkdir -p /app
29
29
 
30
30
  ENTRYPOINT ["/app/config/docker/rails_base/entrypoint.sh"]
31
- WORKDIR /app
31
+ WORKDIR /app
@@ -0,0 +1,4 @@
1
+ FROM selenium/standalone-chrome
2
+ FROM rails_base:latest
3
+ LABEL maintainer='paul@error.agency'
4
+ CMD ["/bin/sh"]
@@ -0,0 +1,19 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ echo "Building Rails dependencies and creating database..."
6
+ echo -n "Bundle..."
7
+ bundle &> /dev/null
8
+ echo "done"
9
+
10
+ echo -n "Yarn..."
11
+ yarn &> /dev/null
12
+ echo "done"
13
+
14
+ echo -n "Rails db:create..."
15
+ rails db:create &> /dev/null
16
+ echo "done"
17
+
18
+ rm -f /app/tmp/pids/server.pid
19
+ exec "$@"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: error_agency-docker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Jones
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2019-10-26 00:00:00.000000000 Z
13
+ date: 2019-12-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -82,9 +82,11 @@ files:
82
82
  - lib/generators/error_agency/docker/development_environment_generator.rb
83
83
  - lib/generators/error_agency/docker/templates/docker_compose.yml.erb
84
84
  - lib/generators/error_agency/docker/templates/elasticsearch/Dockerfile.erb
85
- - lib/generators/error_agency/docker/templates/headless_chrome/Dockerfile.erb
85
+ - lib/generators/error_agency/docker/templates/mysql/my.cnf
86
86
  - lib/generators/error_agency/docker/templates/rails_base/Dockerfile.erb
87
87
  - lib/generators/error_agency/docker/templates/rails_base/entrypoint.sh.erb
88
+ - lib/generators/error_agency/docker/templates/tests/Dockerfile.erb
89
+ - lib/generators/error_agency/docker/templates/web/entrypoint.sh.erb
88
90
  homepage: https://github.com/errorstudio/error_agency-docker
89
91
  licenses:
90
92
  - MIT
@@ -1,2 +0,0 @@
1
- FROM selenium/standalone-chrome
2
- LABEL maintainer='ed@error.agency'