Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gruz0/hanami-docker
Dockerfile and docker-compose.yml for Hanami projects
https://github.com/gruz0/hanami-docker
Last synced: 25 days ago
JSON representation
Dockerfile and docker-compose.yml for Hanami projects
- Host: GitHub
- URL: https://github.com/gruz0/hanami-docker
- Owner: gruz0
- Created: 2018-08-12T11:54:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-12T12:14:16.000Z (over 6 years ago)
- Last Synced: 2024-08-03T18:12:51.472Z (4 months ago)
- Language: Makefile
- Size: 1000 Bytes
- Stars: 13
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-hanami - hanami-docker - Dockerize your Hanami application (Hanami Gem List / Deploy)
README
# Dockerize your Hanami applications
Dockerfile uses Ruby 2.5 Alpine as a base image and
PostgreSQL 10.4 Alpine as a linked container.**Useful commands:**
1. `make dockerize` – build image and run application on 2300 port
2. `make shell` – enter inside container
3. `make shutdown` – stop containerIf you want to create database and run migrations you must simple use:
1. `make shell`
2. `hanami db prepare`
3. `hanami db migrate`### Step 1
Copy `Dockerfile`, `docker-compose.yml` and `Makefile` into your Hanami root directory.
### Step 2
Replace `DATABASE_URL` in your `.env.development` with:
```yaml
DATABASE_URL="postgresql://postgres:example@db/your_project_development
```Replace `DATABASE_URL` in your `.env.test` with:
```yaml
DATABASE_URL="postgresql://postgres:example@db/your_project_test
```### Step 3
Run `make dockerize` in your terminal.
### Final step
Open [http://localhost:2300](http://localhost:2300) in your browser! :beer: