https://github.com/wtnabe/example-cnbp-node-ruby
https://github.com/wtnabe/example-cnbp-node-ruby
cloudnativebuildpack nodejs ruby
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/wtnabe/example-cnbp-node-ruby
- Owner: wtnabe
- License: bsd-2-clause
- Created: 2023-12-16T06:37:32.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-23T07:37:31.000Z (about 2 years ago)
- Last Synced: 2025-03-02T05:27:52.160Z (12 months ago)
- Topics: cloudnativebuildpack, nodejs, ruby
- Language: Ruby
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## An example repo for Vite and Sinatra app with Cloud Native Buildpacks
### Prerequisite
* pack command
* [pack · Cloud Native Buildpacks](https://buildpacks.io/docs/tools/pack/cli/pack/)
* [buildpacks/pack: CLI for building apps using Cloud Native Buildpacks](https://github.com/buildpacks/pack)
* [Node\.js](https://nodejs.org/) ( optional )
* [Ruby Programming Language](https://www.ruby-lang.org/en/)
### How to Use
#### for building image
```
pack build example-cnbp-node-ruby -B heroku/builder:22
```
#### for developing
```
bundle
./bin/vite install
gem install bundler
foreman start -f Procfile.dev
```
### Deploy
Prepare the credentials for each platform so that they can be used in docker command.
#### Heroku
[Container Registry & Runtime \(Docker Deploys\) \| Heroku Dev Center](https://devcenter.heroku.com/articles/container-registry-and-runtime#getting-started)
```
$ heroku container:login
```
```
$ docker tag example-cnbp-node-ruby registry.heroku.com//web
$ docker push registry.heroku.com//web
$ heroku container:release web -a
```
### Cloud Run
[クイックスタート: Docker コンテナ イメージを Artifact Registry に保存する \| Artifact Registry のドキュメント \| Google Cloud](https://cloud.google.com/artifact-registry/docs/docker/store-docker-container-images?hl=ja)
```
$ gcloud auth configure-docker -central1-docker.pkg.dev
```
```
$ docker tag example-cnbp-node-ruby -docker.pkg.dev///
$ docker push -docker.pkg.dev///
$ gcloud run deploy --image -docker.pkg.dev///
```