Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dennis-every/rails-on-docker
Dockerizing a Ruby on Rails application
https://github.com/dennis-every/rails-on-docker
docker rails ruby
Last synced: 26 days ago
JSON representation
Dockerizing a Ruby on Rails application
- Host: GitHub
- URL: https://github.com/dennis-every/rails-on-docker
- Owner: dennis-every
- License: mit
- Created: 2023-01-29T21:06:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-30T01:43:53.000Z (almost 2 years ago)
- Last Synced: 2024-12-06T03:43:55.354Z (about 1 month ago)
- Topics: docker, rails, ruby
- Language: Ruby
- Homepage:
- Size: 44.9 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dockerizing a Ruby on Rails Application
## 📗 Table of Contents
- [📗 Table of Contents](#-table-of-contents)
- [📖 About this project ](#-about-project-)
- [🛠 Built With ](#-built-with-)
- [Tech Stack ](#tech-stack-)
- [Key Features ](#key-features-)
- [💻 Getting Started ](#-getting-started-)
- [Setup](#setup)
- [Usage](#usage)
- [Build steps](#steps)
- [👥 Author ](#-author-)
- [📝 License ](#-license-)
# 📖 Dockerizing a Ruby on Rails application
This is a demo application to show how to use Docker to containerize a Ruby on Rails application.
- Ruby on Rails
- PostgreSql
- Puma
- Docker
- **Use Docker to containerize a Ruby on Rails application**
### Setup
- install Docker from docker.com
- git clone [email protected]:dennis-every/rails-on-docker.git
- cd rails-on-docker
### Usage
- docker compose up
### Build steps
- Create Dockerfile (refer to the file in repo)
- Create a Gemfile with rails version (refer to the file in repo)
- Create an empty Gemfile.lock
- Create an entrypoint.sh script to fix a Rails-specific issue that prevents the server from restarting when a certain server.pid file pre-exists. This script will be executed every time the container gets started (refer to this file in repo)
- Create a docker-compose.yml file (refer to the file in repo)
- Generate the rails app: docker compose run --no-deps web rails new . --force --database=postgresql
- docker compose build
- Update database.yml (refer to the file in repo)
- Boot the app with: docker compose up
- Create the database in another terminal, run: docker compose run web rake db:create
- Go to http://localhost:3000 on a web browser to see the Rails welcome page
- To stop the application, run docker compose down
- References: https://github.com/docker/awesome-compose/tree/master/official-documentation-samples/rails/
👤 **Dennis Every**
- GitHub: [@dennis-every](https://github.com/dennis-every)
This project is [MIT](./MIT.md) licensed