Skip to content

TMS-Thuong/training_ruby

Repository files navigation

Blogs - Rails Application

Rails 7.1 application với PostgreSQL và Redis, chạy trên Docker.

Yêu cầu hệ thống

  • Docker và Docker Compose
  • Git

Cài đặt

1. Clone repository

git clone <repository-url>
cd blogs

2. Cấu hình môi trường

Copy file .env.example thành .env:

cp .env.example .env

3. Build và khởi động services

docker-compose up --build

4. Tạo database

Trong terminal mới, chạy:

docker-compose exec app bin/rails db:create

5. Chạy migrations

docker-compose exec app bin/rails db:migrate

6. Truy cập ứng dụng

Mở trình duyệt và truy cập: http://localhost:3000

Cấu trúc project

blogs/
├── app/                 # Application code
├── config/              # Configuration files
│   ├── database.yml     # Database config (sử dụng DATABASE_URL từ docker-compose)
│   └── ...
├── db/                  # Database migrations và seeds
├── Dockerfile           # Docker image cho Rails app
├── docker-compose.yml   # Docker Compose configuration
├── .env                 # Environment variables (không commit)
├── .env.example         # Template cho .env
└── README.md           # File này

Thông tin kỹ thuật

  • Ruby: 3.2.6
  • Rails: 7.1.0
  • PostgreSQL: 16
  • Redis: 7
  • Database Adapter: pg (PostgreSQL)

Development

Chạy tests

docker-compose exec app bin/rails test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages