Skip to content

alexander-rykhlitskiy/docker-compose-rails-basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Compose config for Rails app

Create files with current user as owner on Linux

Use UID (or --user in run) flag on Linux as follows, so docker creates files with host user as the owner docker/compose#1532

UID=$(id -u) docker-compose run website bin/install

Debugging with pry

Two options:

  1. Attach to running server container with
docker attach $(docker-compose ps | grep website_1 | awk '{print $1}')
  1. Run server with this command instead of docker-compose up
UID=$(id -u) docker-compose run --use-aliases --service-ports website

Running tests

See spec/rails_helper.rb

You want to run feature tests in live mode and see how they go
Two options:

  1. on your local machine
LIVE_CHROME=true rspec spec/features/reports_spec.rb
  1. via VNC (not implemented) https://hub.docker.com/r/siomiz/chrome/

Issues

  • wkhtmltopdf
    • wkhtmltopdf-binary - "file not found", alpine doesn't have some shared libraries
    • apk add wkhtmltopdf - blank page rendered

TODO

  • remove password for postgres
  • run chrome via VNC for tests

Sources

Base structure https://nickjanetakis.com/blog/dockerize-a-rails-5-postgres-redis-sidekiq-action-cable-app-with-docker-compose

database.yml and some other configs https://github.com/nickjj/orats

Some hints (rm pidfile) https://docs.docker.com/compose/rails/

About

Basic Docker Compose config for Rails app

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published