Dockerfile uses Ruby 2.5 Alpine as a base image and PostgreSQL 10.4 Alpine as a linked container.
Useful commands:
make dockerize
– build image and run application on 2300 portmake shell
– enter inside containermake shutdown
– stop container
If you want to create database and run migrations you must simple use:
make shell
hanami db prepare
hanami db migrate
Copy Dockerfile
, docker-compose.yml
and Makefile
into your Hanami root directory.
Replace DATABASE_URL
in your .env.development
with:
DATABASE_URL="postgresql://postgres:example@db/your_project_development
Replace DATABASE_URL
in your .env.test
with:
DATABASE_URL="postgresql://postgres:example@db/your_project_test
Run make dockerize
in your terminal.
Open http://localhost:2300 in your browser! 🍺