What I've learned by Dockerise a Rails app
First thing was to Dockerise an Erlang pub/sub server. The problem is that application can only be started in console or daemon mode. So let's use some shell tricks to wait daemon.
child= # keep the pid in child variable
The application also need to have database ready on boot. This is not possible
with docker because the containers are just started without dependency.
However, there is a trick with links by using docker-wait
.
mongodbready:
image: aanand/wait
links:
- mongodb
app:
image: app
links:
- mongodbready
- mongodb
Dockerfile ADD
instruction handle URL with cache support. It's useful when you
have to get a source tarball.
docker-compose can handle env
files like dotenv
project, and pretty useful
when you have a Rails container and a sidekiq container that shares the same
environment.
- https://docs.docker.com/compose/compose-file/#env_file (documentation is not fixed yet, but will be soon)