Rails API + Nuxt on Docker.
$ mkdir YOUR_PROJECT
$ cd YOUR_PROJECT
$ git clone [email protected]:harayama-developmer/rails-nuxt-template.git .
$ rm -rf .git/
# Rails Setup
$ rm backend/config/credentials.yml.enc
$ docker-compose run --rm backend rails credentials:edit
#=> create config/master.key
# Nuxt Setup
$ touch frontend/.env
#=> Edit .env below
# BASE_URL=http://localhost:3000
# API_URL=http://backend:3000
# API_URL_BROWSER=http://localhost:3000
$ docker-compose build
$ docker-compose run --rm backend bundle exec rails db:setup
$ docker-compose up
Access in browser!
- Nuxt: http://localhost:8080
- Rails: http://localhost:3000
Table:
create_table "events", force: :cascade do |t|
t.string "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end