Giter Site home page Giter Site logo

ledermann / docker-rails Goto Github PK

View Code? Open in Web Editor NEW
1.1K 23.0 170.0 13.13 MB

Dockerize Rails 7 with ActionCable, Webpacker, Stimulus, Elasticsearch, Sidekiq

Home Page: https://docker-rails.ledermann.dev/

License: MIT License

Ruby 75.92% JavaScript 7.47% HTML 2.98% Shell 0.30% Dockerfile 0.30% SCSS 3.86% Slim 9.17%
docker rails ruby deployment reference-implementation sidekiq file-upload stimulusjs actioncable opensearch

docker-rails's Introduction

Docker-Rails

Simple Rails 7.0 application to demonstrate using Docker for production deployment. The application is a very simple kind of CMS (content management system) allowing to manage posts. Beside the boring CRUD functionality it has some non-default features.

This project aims to build a lean Docker image for use in production. Therefore it's based on the official Alpine Ruby image, uses multi-stage building and some optimizations that I described in my blog. This results in an image size of ~80MB.

Features

Why?

This project demonstrates my way of building Rails applications. The techniques used to build the app should not be considered as "best practice", maybe there are better ways to build. Any feedback would be appreciated.

Multi container architecture

There is an example docker-compose.production.yml. The whole stack is divided into multiple different containers:

  • app: Main part. It contains the Rails code to handle web requests (by using the Puma gem). See the Dockerfile for details. The image is based on the Alpine variant of the official Ruby image and uses multi-stage building.
  • worker: Background processing. It contains the same Rails code, but only runs Sidekiq
  • db: PostgreSQL database
  • opensearch: Full text search engine
  • redis: In-memory key/value store (used by Sidekiq, ActionCable and for caching)
  • backup: Regularly backups the database as a dump via CRON to an Amazon S3 bucket

Check it out!

To start up the application in your local Docker environment:

git clone https://github.com/ledermann/docker-rails.git
cd docker-rails
docker-compose build
docker-compose up

Wait some minutes while the database will be prepared by fetching articles from Wikipedia. Then, navigate your browser to http://[DOCKER_HOST]:[DOCKER_PORT].

Sign in to the admin account:

Enjoy!

Tests / CI

On every push, the test suite (including RuboCop checks) is performed via GitHub Actions. If successful, a production image is built and pushed to GitHub Container Registry.

Production deployment

The Docker image build includes precompiled assets only (no node_modules and no sources). The spec folder is removed and the Alpine packages for Node and Yarn are not installed.

The stack is ready to host with traefik or nginx proxy and letsencrypt-nginx-proxy-companion.

Demo

A demo installation is set up on https://docker-rails.ledermann.dev.

docker-rails's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar depfu-bot avatar depfu[bot] avatar greenkeeper[bot] avatar ledermann avatar matias-eduardo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-rails's Issues

Logo Design/Docker-Rails

Hey, I examined that your project has no logo design yet. If you interested I can design a logo for Docker-Rails. We can improve it together if you have an idea or want to add/remove something on design. I'm waiting your feedbacks, have a nice day! (it is not advertisement or something, I want to contribute on your project)

Best Regards,
Baran Pirincal
Visual Communication Designer

Is there a missing "copy . /app" in Dockerfile?

I'm not sure if I'm doing something completely wrong. I've closed this repo and tried to run it, but I get the error below.
Looking at the Dockerfile, I don't see a copy command to get the rails app into docker. I've added this to my own app, which seems to be working. But in this example app (which I really appreciate btw it's incredibly fast to build) doesn't seem to work.

mooktakim ~/Workspace/docker-rails 3.0.0 (develop) $ docker-compose up --build                                                                            130 ↵
Building app
[+] Building 1.3s (10/10) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                       0.0s
 => => transferring dockerfile: 37B                                                                                                                        0.0s
 => [internal] load .dockerignore                                                                                                                          0.0s
 => => transferring context: 35B                                                                                                                           0.0s
 => [internal] load metadata for docker.io/ledermann/rails-base-final:3.0.0-alpine                                                                         0.6s
 => [stage-1 1/2] FROM docker.io/ledermann/rails-base-final:3.0.0-alpine@sha256:65efbea22e8d953689e75e72b106fbbc31f948de07fe47f83aa09f3f41abc0a0           0.0s
 => [builder 1/2] FROM docker.io/ledermann/rails-base-builder:3.0.0-alpine                                                                                 0.5s
 => => resolve docker.io/ledermann/rails-base-builder:3.0.0-alpine                                                                                         0.5s
 => CACHED [stage-1 2/2] RUN addgroup -g 1000 -S app &&             adduser -u 1000 -S app -G app                                                          0.0s
 => CACHED [stage-1 3/2] COPY --from=Builder --chown=app:app /usr/local/bundle/ /usr/local/bundle/                                                         0.0s
 => CACHED [stage-1 4/2] COPY --from=Builder --chown=app:app /app /app                                                                                     0.0s
 => CACHED [stage-1 5/2] RUN apk add --no-cache imagemagick                                                                                                0.0s
 => exporting to image                                                                                                                                     0.0s
 => => exporting layers                                                                                                                                    0.0s
 => => writing image sha256:5723a8c71614e3a11b15a074f8c2d32d27fff24dd30d4f479012cec420915600                                                               0.0s
 => => naming to docker.io/library/docker-rails_app                                                                                                        0.0s
Successfully built 5723a8c71614e3a11b15a074f8c2d32d27fff24dd30d4f479012cec420915600
Building worker
[+] Building 0.5s (10/10) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                       0.0s
 => => transferring dockerfile: 37B                                                                                                                        0.0s
 => [internal] load .dockerignore                                                                                                                          0.0s
 => => transferring context: 35B                                                                                                                           0.0s
 => [internal] load metadata for docker.io/ledermann/rails-base-final:3.0.0-alpine                                                                         0.2s
 => [stage-1 1/2] FROM docker.io/ledermann/rails-base-final:3.0.0-alpine@sha256:65efbea22e8d953689e75e72b106fbbc31f948de07fe47f83aa09f3f41abc0a0           0.0s
 => [builder 1/2] FROM docker.io/ledermann/rails-base-builder:3.0.0-alpine                                                                                 0.2s
 => => resolve docker.io/ledermann/rails-base-builder:3.0.0-alpine                                                                                         0.2s
 => CACHED [stage-1 2/2] RUN addgroup -g 1000 -S app &&             adduser -u 1000 -S app -G app                                                          0.0s
 => CACHED [stage-1 3/2] COPY --from=Builder --chown=app:app /usr/local/bundle/ /usr/local/bundle/                                                         0.0s
 => CACHED [stage-1 4/2] COPY --from=Builder --chown=app:app /app /app                                                                                     0.0s
 => CACHED [stage-1 5/2] RUN apk add --no-cache imagemagick                                                                                                0.0s
 => exporting to image                                                                                                                                     0.0s
 => => exporting layers                                                                                                                                    0.0s
 => => writing image sha256:5723a8c71614e3a11b15a074f8c2d32d27fff24dd30d4f479012cec420915600                                                               0.0s
 => => naming to docker.io/library/docker-rails_worker                                                                                                     0.0s
Successfully built 5723a8c71614e3a11b15a074f8c2d32d27fff24dd30d4f479012cec420915600
docker-rails_db_1 is up-to-date
docker-rails_redis_1 is up-to-date
docker-rails_elasticsearch_1 is up-to-date
Starting docker-rails_app_1 ... error

ERROR: for docker-rails_app_1  Cannot start service app: OCI runtime create failed: container_linux.go:370: starting container process caused: exec: "docker/startup.sh": stat docker/startup.sh: no such file or directory: unknown

ERROR: for app  Cannot start service app: OCI runtime create failed: container_linux.go:370: starting container process caused: exec: "docker/startup.sh": stat docker/startup.sh: no such file or directory: unknown
ERROR: Encountered errors while bringing up the project.

what/where is URL to access app locally?

git clone https://github.com/ledermann/docker-rails.git
cd docker-rails
docker-compose build
docker-compose up

Um, out of the box, what is the URL... e.g., what/where is DOCKER_HOST?

On Mac, neither 127.0.0.1:3000 nor localhost:3000 do not work.

When running Docker-compose up, it does show Listening on http://0.0.0.0:3000 but I do not see what DOCKER_HOST is expected to access locally via browser.

An in-range update of react is breaking the build 🚨

There have been updates to the react monorepo:

    • The dependency react was updated from 16.5.2 to 16.6.0.
  • The dependency react-dom was updated from 16.5.2 to 16.6.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the react group definition.

react is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

How run Rspec (and scaffolding)

This cool a multi-stage Dockerize Rails app you have created. But after doing a quick smoke-test docker build . then docker-compose up browsing the app, then ^C to quit, I am now trying to get past some of the magic obscuring the most basic workflows.

It's probably my lack of experience with multi-stage builds, but anything rspec-related does not seem accessible the usual way:

How does one invoke rspec locally, and, invoke scaffolding to create rspec tests instead of /app/test?

docker-compose run --rm app rspec

gives:

Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: exec: "rspec": executable file not found in $PATH: unknown
ERROR: 1

or

docker-compose run --rm app rails g scaffold Foo title:string body:text status:string

fails when tries to create spec in test folder stead of rspec folder:

      invoke  active_record
      create    db/migrate/20210518034404_create_foos.rb
      create    app/models/foo.rb
      invoke    test_unit
/usr/local/lib/ruby/3.0.0/fileutils.rb:253:in `mkdir': Permission denied @ dir_s_mkdir - /app/test (Errno::EACCES)

Hot reloading of JavaScript

Does this project support hot reloading of assets via the webpack dev server? If yes, does it come out of the box?

Running in Development

Not sure it's an issue. I don't have Rails installed locally and I'm facing this error when I change Gemfile and run docker-compose run app bundle install

There was an error while trying to write to /usr/local/bundle/config. It is likely that you need to grant write permissions for that path.

What's the proper way to deal with this and use in dev mode?

docker-rails-elasticsearch-1 exited with code 137

i got elasticsearch error with docker-rails-elasticsearch-1 exited with code 137
elasticsearch was not running.

docker-rails-elasticsearch-1  | {"type": "server", "timestamp": "2022-02-27T04:31:48,611Z", "level": "INFO", "component": "o.e.i.g.GeoIpDownloader", "cluster.name": "docker-cluster", "node.name": "69b0e8b669a8", "message": "updated geoip database [GeoLite2-ASN.mmdb]", "cluster.uuid": "oVWhq53zQrOjnrQ1oRXFFA", "node.id": "Kpnd4j2MSoKa0jCfbCc1Yw"  }
docker-rails-elasticsearch-1  | {"type": "server", "timestamp": "2022-02-27T04:31:48,629Z", "level": "INFO", "component": "o.e.i.g.GeoIpDownloader", "cluster.name": "docker-cluster", "node.name": "69b0e8b669a8", "message": "updating geoip database [GeoLite2-City.mmdb]", "cluster.uuid": "oVWhq53zQrOjnrQ1oRXFFA", "node.id": "Kpnd4j2MSoKa0jCfbCc1Yw"  }
docker-rails-elasticsearch-1  | {"type": "server", "timestamp": "2022-02-27T04:31:48,921Z", "level": "INFO", "component": "o.e.i.g.DatabaseNodeService", "cluster.name": "docker-cluster", "node.name": "69b0e8b669a8", "message": "successfully reloaded changed geoip database file [/tmp/elasticsearch-5151365541444706863/geoip-databases/Kpnd4j2MSoKa0jCfbCc1Yw/GeoLite2-ASN.mmdb]", "cluster.uuid": "oVWhq53zQrOjnrQ1oRXFFA", "node.id": "Kpnd4j2MSoKa0jCfbCc1Yw"  }
docker-rails-elasticsearch-1 exited with code 137
docker-rails-worker-1         | 2022-02-27T04:31:57.917Z pid=1 tid=cp9 INFO: Booting Sidekiq 6.4.1 with redis options {:url=>"redis://redis:6379/0"}
docker-rails-worker-1         | 2022-02-27T04:31:57.958Z pid=1 tid=cp9 INFO: Cron Jobs - add job with name: wikipedia
docker-rails-worker-1         | 2022-02-27T04:32:02.043Z pid=1 tid=cp9 INFO: Booted Rails 7.0.2.2 application in production environment
docker-rails-worker-1         | 2022-02-27T04:32:02.044Z pid=1 tid=cp9 INFO: Running in ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux-musl]
docker-rails-worker-1         | 2022-02-27T04:32:02.044Z pid=1 tid=cp9 INFO: See LICENSE and the LGPL-3.0 for licensing details.
docker-rails-worker-1         | 2022-02-27T04:32:02.044Z pid=1 tid=cp9 INFO: Upgrade to Sidekiq Pro for more features and support: https://sidekiq.org
docker-rails-db-1             | 2022-02-27 04:32:04.762 UTC [56] FATAL:  database "docker-rails_production" does not exist
docker-rails-app-1            | Created database 'docker-rails_production'
docker-rails-app-1            | Create admin user...
docker-rails-app-1            | rake aborted!
docker-rails-app-1            | Faraday::ConnectionFailed: Failed to open TCP connection to elasticsearch:9200 (getaddrinfo: Name does not resolve)
docker-rails-app-1            | /usr/local/bundle/gems/faraday-net_http-1.0.1/lib/faraday/adapter/net_http.rb:138:in `request_via_get_method'
docker-rails-app-1            | /usr/local/bundle/gems/faraday-net_http-1.0.1/lib/faraday/adapter/net_http.rb:129:in `request_with_wrapped_block'
docker-rails-app-1            | /usr/local/bundle/gems/faraday-net_http-1.0.1/lib/faraday/adapter/net_http.rb:122:in `perform_request'
docker-rails-app-1            | /usr/local/bundle/gems/faraday-net_http-1.0.1/lib/faraday/adapter/net_http.rb:66:in `block in call'

error Couldn't find the binary git

Thanks for your work on this project.

Just pulled latest on develop default branch and ran commands as per 'Check it out' section in the README.

after docker-compose run app yarn install I get error Couldn't find the binary git in the output. Any ideas how to fix that?

(macOS 10.14.3 and Docker Desktop Version 2.0.0.2 (30215))

An in-range update of @rails/webpacker is breaking the build 🚨

The dependency @rails/webpacker was updated from 4.0.1 to 4.0.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@rails/webpacker is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 1 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

docker/startup.sh: no such file or directory": unknown

Environment: Docker Toolbox for Windows 10 (Home Edition)
Here is the full log:

$ docker-compose up
Creating network "dockerrails_default" with the default driver
Creating dockerrails_db_1 ... done
Creating dockerrails_elasticsearch_1 ... done
Creating dockerrails_redis_1 ... done
Creating dockerrails_app_1 ... error

ERROR: for dockerrails_app_1 Cannot start service app: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: "docker/startup.sh": stat docker/startup.sh: no such file or directory": unknown

ERROR: for app Cannot start service app: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: "docker/startup.sh": stat docker/startup.sh: no such file or directory": unknown
ERROR: Encountered errors while bringing up the project.

An in-range update of webpack-dev-server is breaking the build 🚨

The devDependency webpack-dev-server was updated from 3.5.1 to 3.6.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

webpack-dev-server is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v3.6.0

3.6.0 (2019-06-05)

Bug Fixes

Features

Commits

The new version differs by 17 commits.

  • 9582418 chore(release): 3.6.0
  • 699f8b4 fix(server): don't ignore node_modules by default (#1970)
  • 53f4253 chore(deps): update dependency webpack to ^4.33.0 (#1966)
  • dc81e23 fix(config): enable --overlay (#1968)
  • 0783a4a test: change jest.setTimeout from 20000 to 30000 (#1965)
  • 397bec8 docs(options): added urls for new inject options (#1959)
  • 428f410 chore(deps): update dependency commitlint-azure-pipelines-cli to ^1.0.2 (#1964)
  • 2a03295 chore(deps): delete nyc dependency (#1962)
  • 27eb99c test: delete temp directory (#1958)
  • 79325e5 test(client): add tests for default/index.js (#1957)
  • d346a53 test(server): add SockJSServer test (#1956)
  • eecc1e4 refactor: insert client implementation from within Dev Server API (#1933)
  • 6973e4c refactor(client): create log module into utils (#1953)
  • 1581adc refactor(client): create createSocketUrl module into utils (#1954)
  • 9a1ad89 test(routes): stop checking for res.text (#1952)

There are 17 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of css-loader is breaking the build 🚨

The devDependency css-loader was updated from 2.1.0 to 2.1.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

css-loader is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v2.1.1

2.1.1 (2019-03-07)

Bug Fixes

  • do not break selector with escaping (#896) (0ba8c66)
  • source map generation when sourceRoot is present (#901) (e9ce745)
  • sourcemap generating when previous loader pass sourcemap as string (#905) (3797e4d)
Commits

The new version differs by 13 commits.

  • bc16c3d chore(release): 2.1.1
  • b671db7 fix: don't remove value from attribute selector (#904)
  • 3797e4d fix: sourcemap generating when previous loader pass sourcemap as string (#905)
  • cc81af1 refactor: stuff (#903)
  • e9ce745 fix: source map generation when sourceRoot is present (#901)
  • a49e904 docs: improve documentation for hashPrefix, context, getLocalIdent (#900)
  • c309788 refactor: avoid lodash in favor native implementations
  • 0ba8c66 fix: do not break selector with escaping (#896)
  • 2293eb0 chore: update defaults (#895)
  • 2a2ee7b docs: sourceMaps are disabled by default (#890)
  • 2d45e95 test: base64 (#888)
  • 1fb8948 docs: update README.md (#885)
  • 034f9a3 test: emoji (#881)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

ERROR: No such service: yarn

Following the "Check it out!" instructions
After having run docker-compose build succesfully (assuming a couple webpacker warnings are expected)
docker-compose run yarn install outputs
ERROR: No such service: yarn

docker-compose error

Hello, I'm still new with docker, I have clone this project and when try to docker-compose, i got an error said

debconf: delaying package configuration, since apt-utils is not installed
Fetched 2,684 kB in 51s (51.9 kB/s)
Selecting previously unselected package fonts-lato.
(Reading database ... 34855 files and directories currently installed.)
Preparing to unpack .../fonts-lato_2.0-1_all.deb ...
Unpacking fonts-lato (2.0-1) ...
Setting up fonts-lato (2.0-1) ...
Processing triggers for fontconfig (2.11.0-6.7+b1) ...

2.0%

curl: (56) SSL read: error:00000000:lib(0):func(0):reason(0), errno 104
ERROR: Service 'app' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y libxrender1 libxext6 fonts-lato --no-install-recommends && rm -rf /var/lib/apt/lists/* && curl -L#o wk.tar.xz https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz && tar xf wk.tar.xz && cp wkhtmltox/bin/wkhtmltopdf /usr/bin && cp wkhtmltox/bin/wkhtmltoimage /usr/bin && rm wk.tar.xz && rm -r wkhtmltox' returned a non-zero code: 56

do you know how to solve this problem ?

Thanks for sharing

An in-range update of eslint-plugin-import is breaking the build 🚨

The devDependency eslint-plugin-import was updated from 2.16.0 to 2.17.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-import is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 61 commits.

  • 0499050 bump to v2.17.0
  • f479635 [webpack] v0.11.1
  • 8a4226d Merge pull request #1320 from bradzacher/export-ts-namespaces
  • 988e12b fix(export): Support typescript namespaces
  • 70c3679 [docs] make rule names consistent
  • 6ab25ea [Tests] skip a TS test in eslint < 4
  • 405900e [Tests] fix tests from #1319
  • 2098797 [fix] export: false positives for typescript type + value export
  • 70a59fe [fix] Fix overwriting of dynamic import() CallExpression
  • e4850df [ExportMap] fix condition for checking if block comment
  • 918567d [fix] namespace: add check for null ExportMap
  • 2d21c4c Merge pull request #1297 from echenley/ech/fix-isBuiltIn-local-aliases
  • 0ff1c83 [dev deps] lock typescript to ~, since it doesn’t follow semver
  • 40bf40a [*] [deps] update resolve
  • 28dd614 Merge pull request #1304 from bradennapier/feature/typescript-export-type

There are 61 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of jquery is breaking the build 🚨

The dependency jquery was updated from 3.3.1 to 3.4.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

jquery is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Yarn is missing in the app-container in develop branch?

I followed the Readme, with the following commands.

git clone https://github.com/ledermann/docker-rails.git
cd docker-rails
docker-compose build
docker-compose up

However when accessing http://[DOCKER_HOST]:[DOCKER_PORT], this error is printed.

app_1            | F, [2020-05-06T08:44:05.781549 #56] FATAL -- : [ba24857e-394d-4191-b134-27e8dce2f648]
app_1            | [ba24857e-394d-4191-b134-27e8dce2f648] ActionView::Template::Error (Webpacker can't find application.js in /app/public/packs/manifest.json. Possible causes:
app_1            | 1. You want to set webpacker.yml value of compile to true for your environment
app_1            |    unless you are using the `webpack -w` or the webpack-dev-server.
app_1            | 2. webpack has not yet re-run to reflect updates.
app_1            | 3. You have misconfigured Webpacker's config/webpacker.yml file.
app_1            | 4. Your webpack configuration is not creating a manifest.
app_1            | Your manifest contains:
app_1            | {

So found in the master branch that I need to run

 docker-compose run app yarn install

However Yarn does not exists in the app-container.

Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"yarn\": executable file not found in $PATH": unknown

So what I did to solve this was

docker-compose exec -u root app run apk add yarn
docker-compose exec app sh
yarn install

But still no luck, after restarting the server.

Switching to the master branch, and running the setup, works fine.

nc: bad address 'elasticsearch'

I have complete previous steps. And when I run
docker-compose up

app_1            | Waiting for Elasticsearch...
elasticsearch_1  | [2019-07-23T07:52:54,795][INFO ][o.e.n.Node               ] [ih9IFcF] initialized
elasticsearch_1  | [2019-07-23T07:52:54,795][INFO ][o.e.n.Node               ] [ih9IFcF] starting ...
elasticsearch_1  | [2019-07-23T07:52:55,172][INFO ][o.e.t.TransportService   ] [ih9IFcF] publish_address {172.22.0.2:9300}, bound_addresses {0.0.0.0:9300}
elasticsearch_1  | [2019-07-23T07:52:55,181][INFO ][o.e.b.BootstrapChecks    ] [ih9IFcF] bound or publishing to a non-loopback address, enforcing bootstrap checks
elasticsearch_1  | ERROR: [1] bootstrap checks failed
elasticsearch_1  | [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
elasticsearch_1  | [2019-07-23T07:52:55,185][INFO ][o.e.n.Node               ] [ih9IFcF] stopping ...
elasticsearch_1  | [2019-07-23T07:52:55,203][INFO ][o.e.n.Node               ] [ih9IFcF] stopped
elasticsearch_1  | [2019-07-23T07:52:55,203][INFO ][o.e.n.Node               ] [ih9IFcF] closing ...
elasticsearch_1  | [2019-07-23T07:52:55,214][INFO ][o.e.n.Node               ] [ih9IFcF] closed
app_1            | Waiting for Elasticsearch...
dockerrails_elasticsearch_1 exited with code 78
worker_1         | W, [2019-07-23T07:53:03.169031 #1]  WARN -- Skylight: [SKYLIGHT] [4.1.2] Running Skylight in development mode. No data will be reported until you deploy your app.
worker_1         | (To disable this message for all local apps, run `skylight disable_dev_warning`.)
worker_1         | 2019-07-23T07:53:03.437Z 1 TID-gppwkku85 INFO: Booting Sidekiq 5.2.7 with redis options {:url=>"redis://redis:6379/0", :id=>"Sidekiq-server-PID-1"}
worker_1         | 2019-07-23T07:53:03.474Z 1 TID-gppwkku85 INFO: Cron Jobs - add job with name: wikipedia
worker_1         | 2019-07-23T07:53:12.290Z 1 TID-gppwkku85 INFO: Running in ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux-musl]
worker_1         | 2019-07-23T07:53:12.290Z 1 TID-gppwkku85 INFO: See LICENSE and the LGPL-3.0 for licensing details.
worker_1         | 2019-07-23T07:53:12.290Z 1 TID-gppwkku85 INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org
worker_1         | 2019-07-23T07:53:12.309Z 1 TID-gppwkku85 INFO: Starting processing, hit Ctrl-C to stop
app_1            | nc: elasticsearch (172.22.0.2:9200): Operation timed out
app_1            | Waiting for Elasticsearch...
app_1            | nc: bad address 'elasticsearch'
app_1            | nc: bad address 'elasticsearch'
app_1            | Waiting for Elasticsearch...

What should I do? I am new to docker.

Some low-effort gems you could add

This is a great idea! It's hard to find simple, production-ready implementations of rails tools in the wild. This is quite refreshing.

Have you considered adding these gems: 'searchjoy', 'pghero', 'friendly_id', 'bootsnap', or 'oj'?

An in-range update of blueimp-file-upload is breaking the build 🚨

The dependency blueimp-file-upload was updated from 9.24.0 to 9.24.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

blueimp-file-upload is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 3 commits.

  • d17e601 9.24.1
  • a513d51 Update VULNERABILITIES documentation.
  • ad4aefd SECURITY FIX: Only allow image file types by default.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Development

In docker, the idea is to mantain more or less the same dockerfiles (or docker-compose) between development and production enviroments. In the case of development, what's your recommendation?

For example, a proper .dev with RAILS_ENV=production, eliminate NGINX (Puma or Unicorn is enough). What about logging?

Thanks for sharing your work!

An in-range update of eslint is breaking the build 🚨

The devDependency eslint was updated from 5.13.0 to 5.14.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v5.14.0
  • 85a04b3 Fix: adds conditional for separateRequires in one-var (fixes #10179) (#10980) (Scott Stern)
  • 0c02932 Upgrade: [email protected] (#11401) (Ilya Volodin)
  • 104ae88 Docs: Update governance doc with reviewers status (#11399) (Nicholas C. Zakas)
  • ab8ac6a Fix: Support boundary spread elements in sort-keys (#11158) (Jakub Rożek)
  • a23d197 New: add allowSingleLineBlocks opt. to padded-blocks rule (fixes #7145) (#11243) (richie3366)
  • e25e7aa Fix: comma-spacing ignore comma before closing paren (fixes #11295) (#11374) (Pig Fang)
  • a1f7c44 Docs: fix space-before-blocks correct code for "classes": "never" (#11391) (PoziWorld)
  • 14f58a2 Docs: fix grammar in object-curly-spacing docs (#11389) (PoziWorld)
  • d3e9a27 Docs: fix grammar in “those who says” (#11390) (PoziWorld)
  • ea8e804 Docs: Add note about support for object spread (fixes #11136) (#11395) (Steven Thomas)
  • 95aa3fd Docs: Update README team and sponsors (ESLint Jenkins)
  • 51c4972 Update: Behavior of --init (fixes #11105) (#11332) (Nicholas C. Zakas)
  • ad7a380 Docs: Update README team and sponsors (ESLint Jenkins)
  • 550de1e Update: use default keyword in JSON schema (fixes #9929) (#11288) (Pig Fang)
  • 983c520 Update: Use 'readonly' and 'writable' for globals (fixes #11359) (#11384) (Nicholas C. Zakas)
  • f1d3a7e Upgrade: some deps (fixes #11372) (#11373) (薛定谔的猫)
  • 3e0c417 Docs: Fix grammar in “there’s nothing prevent you” (#11385) (PoziWorld)
  • de988bc Docs: Fix grammar: Spacing improve -> Spacing improves (#11386) (PoziWorld)
  • 1309dfd Revert "Build: fix test failure on Node 11 (#11100)" (#11375) (薛定谔的猫)
  • 1e56897 Docs: “the function actually use”: use -> uses (#11380) (PoziWorld)
  • 5a71bc9 Docs: Update README team and sponsors (ESLint Jenkins)
  • 82a58ce Docs: Update README team and sponsors (ESLint Jenkins)
  • 546d355 Docs: Update README with latest sponsors/team data (#11378) (Nicholas C. Zakas)
  • c0df9fe Docs: ... is not an operator (#11232) (Felix Kling)
  • 7ecfdef Docs: update typescript parser (refs #11368) (#11369) (薛定谔的猫)
  • 3c90dd7 Update: remove prefer-spread autofix (fixes #11330) (#11365) (薛定谔的猫)
  • 5eb3121 Update: add fixer for prefer-destructuring (fixes #11151) (#11301) (golopot)
  • 173eb38 Docs: Clarify ecmaVersion doesn't imply globals (refs #9812) (#11364) (Keith Maxwell)
  • 84ce72f Fix: Remove extraneous linefeeds in one-var fixer (fixes #10741) (#10955) (st-sloth)
  • 389362a Docs: clarify motivation for no-prototype-builtins (#11356) (Teddy Katz)
  • 533d240 Update: no-shadow-restricted-names lets unassigned vars shadow undefined (#11341) (Teddy Katz)
  • d0e823a Update: Make --init run js config files through linter (fixes #9947) (#11337) (Brian Kurek)
  • 92fc2f4 Fix: CircularJSON dependency warning (fixes #11052) (#11314) (Terry)
  • 4dd19a3 Docs: mention 'prefer-spread' in docs of 'no-useless-call' (#11348) (Klaus Meinhardt)
  • 4fd83d5 Docs: fix a misleading example in one-var (#11350) (薛定谔的猫)
  • 9441ce7 Chore: update incorrect tests to fix build failing (#11354) (薛定谔的猫)
Commits

The new version differs by 38 commits.

  • af9688b 5.14.0
  • 0ce3ac7 Build: changelog update for 5.14.0
  • 85a04b3 Fix: adds conditional for separateRequires in one-var (fixes #10179) (#10980)
  • 0c02932 Upgrade: [email protected] (#11401)
  • 104ae88 Docs: Update governance doc with reviewers status (#11399)
  • ab8ac6a Fix: Support boundary spread elements in sort-keys (#11158)
  • a23d197 New: add allowSingleLineBlocks opt. to padded-blocks rule (fixes #7145) (#11243)
  • e25e7aa Fix: comma-spacing ignore comma before closing paren (fixes #11295) (#11374)
  • a1f7c44 Docs: fix space-before-blocks correct code for "classes": "never" (#11391)
  • 14f58a2 Docs: fix grammar in object-curly-spacing docs (#11389)
  • d3e9a27 Docs: fix grammar in “those who says” (#11390)
  • ea8e804 Docs: Add note about support for object spread (fixes #11136) (#11395)
  • 95aa3fd Docs: Update README team and sponsors
  • 51c4972 Update: Behavior of --init (fixes #11105) (#11332)
  • ad7a380 Docs: Update README team and sponsors

There are 38 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of react is breaking the build 🚨

There have been updates to the react monorepo:

    • The dependency react was updated from 16.6.1 to 16.6.2.
  • The dependency react-dom was updated from 16.6.1 to 16.6.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the react group definition.

react is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Listening on But Refused to Connect

I already did what the tutorial ask:

See the ps command:
$ docker container ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f715531cff67 dockerrails_app_development "bundle exec sidekiq" About an hour ago Up About an hour 3000/tcp docker-rails_worker_1 82c4d836acff dockerrails_app_development "docker/startup.sh" About an hour ago Up About an hour 0.0.0.0:32768->3000/tcp docker-rails_app_1 3ed2cd8cb8ca postgres:alpine "docker-entrypoint.s…" About an hour ago Up About an hour 5432/tcp docker-rails_db_1 86cd2e75c561 redis:5.0-alpine "docker-entrypoint.s…" About an hour ago Up About an hour 6379/tcp docker-rails_redis_1

docker-rails_app_1 log:

$ docker logs docker-rails_app_1
... Tasks: TOP => db:setup => db:seed (See full trace by running task with --trace) Done! [903] Puma starting in cluster mode... [903] * Version 3.12.0 (ruby 2.5.3-p105), codename: Llamas in Pajamas [903] * Min threads: 5, max threads: 5 [903] * Environment: development [903] * Process workers: 2 [903] * Preloading application W, [2018-12-27T00:10:26.759679 #903] WARN -- Skylight: [SKYLIGHT] [3.1.2] Running Skylight in development mode. No data will be reported until you deploy your app. (To disable this message for all local apps, run skylight disable_dev_warning.) [903] * Listening on tcp://0.0.0.0:3000 [903] * Listening on unix:///tmp/run.sock [903] ! WARNING: Detected 1 Thread(s) started in app boot: [903] ! #<Thread:0x000055cc9d257c58@/usr/local/bundle/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:299 sleep> - /usr/local/bundle/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:301:in ``sleep' [903] Use Ctrl-C to stop [903] - Worker 0 (pid: 928) booted, phase: 0 [903] - Worker 1 (pid: 935) booted, phase: 0

And docker-rails_worker_1 log:

$ docker logs docker-rails_worker_1
2018-12-26T23:57:06.057Z 1 TID-gt06y6qop INFO: Booting Sidekiq 5.2.3 with redis options {:url=>"redis://redis:6379/0", :id=>"Sidekiq-server-PID-1"} 2018-12-26T23:57:06.267Z 1 TID-gt06y6qop INFO: Cron Jobs - add job with name: wikipedia W, [2018-12-26T23:57:08.073863 #1] WARN -- Skylight: [SKYLIGHT] [3.1.2] Running Skylight in development mode. No data will be reported until you deploy your app. (To disable this message for all local apps, run skylight disable_dev_warning.) 2018-12-26T23:57:25.116Z 1 TID-gt06y6qop INFO: Running in ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux-musl] 2018-12-26T23:57:25.116Z 1 TID-gt06y6qop INFO: See LICENSE and the LGPL-3.0 for licensing details. 2018-12-26T23:57:25.116Z 1 TID-gt06y6qop INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org 2018-12-26T23:57:25.121Z 1 TID-gt06y6qop INFO: Starting processing, hit Ctrl-C to stop

But refused to connect.
$ telnet localhost 3000
Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused

Any suggestions to solve the issue?

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.