Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eclectic-coding/rails_docker
https://github.com/eclectic-coding/rails_docker
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/eclectic-coding/rails_docker
- Owner: eclectic-coding
- Created: 2021-03-16T20:04:01.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-26T09:58:38.000Z (over 2 years ago)
- Last Synced: 2024-12-01T12:07:51.228Z (26 days ago)
- Language: Ruby
- Size: 41 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Use this template](https://img.shields.io/badge/Use_this_template-2ea44f?style=for-the-badge&logo=github)](https://github.com/Ruby-Starter-Kits/Docker-Rails-Template/generate)
# Rails App
Welcome to your [Ruby On Rails](https://rubyonrails.org/) app.
## Setup & Running Locally
Clone down the repo, install [Docker](https://hub.docker.com/editions/community/docker-ce-desktop-mac/) & run:
```bash
$ docker-compose build
$ docker-compose run --rm web bin/setup
$ docker-compose up
```This will build the docker image, then setup the `bin/setup` file which will run `bundle`, `yarn` & create the database.
Then navigate your browser to https://127.0.0.1:3000/ to see your site.
### Running one of commands
To run a one off command, run it within the web service, e.g:
```bash
$ docker-compose run --rm web rails db:migrate
```### Restoring a database
If you have an existing database dump in a file called `latest.dump`, you can restore it by turning on just the postgres service in one terminal tab, and running `pg_restore` in a secondary tab:
```bash
$ docker-compose up postgres
$ pg_restore --verbose --clean --no-acl --no-owner -j 2 -h localhost -d App_development --username postgres latest.dump
```## Tests
The template comes preconfigured with [RSpec](https://rspec.info/) for tests, and comes with a [GitHub Action](https://github.com/Ruby-Starter-Kits/Docker-Rails-Template/blob/master/.github/workflows/tests.yml) to run them when you push to GitHub.
You can run RSpec locally by running:
```bash
$ docker-compose -f docker-compose.ci.yml run --rm test
```## Linting
This app uses [Standard](https://github.com/testdouble/standard) for Ruby and includes a [GitHub Action](https://github.com/Ruby-Starter-Kits/Docker-Rails-Template/blob/master/.github/workflows/standard.yml) to check future commits are up to standard.
## Contributing
This was generated by [Ruby-Starter-Kits/Docker-Rails-Generator](https://github.com/Ruby-Starter-Kits/Docker-Rails-Generator), if you have any ideas please report them there :)
## Usage
Feel free to use these as a starting point for your own Ruby on Rails project!
## Resources
* [Ruby on Rails Guides](https://guides.rubyonrails.org/)
* [Ruby on Rails API Documentation](https://api.rubyonrails.org/)
* [Heroku](https://www.heroku.com/)
* [Docker-Rails-Generator](https://github.com/Ruby-Starter-Kits/Docker-Rails-Generator)## License
[MIT](https://opensource.org/licenses/MIT)
Copyright (c) 2020-present, [Mike Rogers](https://mikerogers.io/)