shuntagami / rails_mysql

Dockerized Rails app skelton

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shuntagami/rails_mysql

This is a dockerized Rails6 application template.

keywords

  • Database: MySQL
  • Test: Rspec
  • CI: Github Actions
  • Webpacker (Asset Pipeline/Sprockets is disabled)
  • OpenAPI
  • API schema test: committee-rails

How to use

Development build by docker-compose

$ make all

FYI: Development build without docker-compose

$ docker network create rails-network # Create a network of rails-network
$ docker build -t mysql docker/mysql/. # Buiid a mysql image.
$ docker run --name mysql --platform linux/x86_64 --net rails-network -d --env-file ./docker/mysql/.env -v db-data:/var/lib/mysql mysql # Run a postgres image with a specific network and env-file.
$ docker build --target development -t my-api . # Build a rails-app image of my-api.
$ docker run --rm --name rails_mysql --env-file .env --net rails-network -d -p 3000:3000 -v $(pwd):/opt/app my-api # Run a rails-app image with a specific network and env-file.

Health check

$ curl localhost:3000/api/_healthcheck
{"message":"OK"}

Production build

$ make image.build # build docker image for production.
$ make image.push # push to docker registry.

You can pull my image from docker hub.

About

Dockerized Rails app skelton


Languages

Language:Ruby 75.0%Language:HTML 10.5%Language:JavaScript 6.0%Language:Dockerfile 3.5%Language:Makefile 3.2%Language:Slim 1.0%Language:Shell 0.8%Language:SCSS 0.0%