app.yaml로 앱 구성

App Engine 앱은 CPU, 메모리, 네트워크 및 디스크 리소스, 확장, 환경 변수를 비롯한 기타 일반 설정이 포함된 app.yaml 파일을 사용하여 구성됩니다.

app.yaml 파일 정보

버전과 URL이 포함된 Ruby 앱의 런타임 구성을 app.yaml 파일에 지정할 수 있습니다. 이 파일은 특정 서비스 버전의 배포 설명자 역할을 합니다.

추가 서비스를 위해 app.yaml 파일을 만들고 배포하려면 먼저 default 서비스의 app.yaml 파일을 만들어야 합니다.

다음 app.yaml은 버전 3.1 및 버전 3.2의 Ruby 앱 구성 방법을 보여줍니다. 참고로 새 버전을 사용하려면 app.yaml을 업데이트해야 합니다. 새 런타임 사용에 대한 자세한 내용은 Ruby 런타임을 참조하세요.

버전 3.2

runtime: ruby
env: flex
entrypoint: bundle exec ruby app.rb

runtime_config:
  operating_system: ubuntu22

# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/ruby/configuring-your-app-with-app-yaml
manual_scaling:
  instances: 1
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

버전 3.1 이하

runtime: ruby
env: flex
entrypoint: bundle exec ruby app.rb

# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/ruby/configuring-your-app-with-app-yaml
manual_scaling:
  instances: 1
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

앱 서비스의 복잡성에 따라 해당 app.yaml 파일에 몇 가지 요소만 정의해야 할 수 있습니다. 다음 예에서는 가변형 환경에서 간단한 Ruby 앱에 필요한 사항을 설명합니다.

app.yaml 파일에 고유한 이름을 지정할 수 있습니다. 하지만 이렇게 하면 배포 명령어에도 파일 이름을 지정해야 합니다. 예를 들어 app.yaml 파일의 이름을 service-name-app.yaml이나 app.flexible.yaml로 지정한 후 다음 중 하나를 사용하여 앱을 배포해야 합니다.

gcloud app deploy service-name-app.yaml
gcloud app deploy app.flexible.yaml
앱에서 여러 서비스와 app.yaml 파일을 구조화하는 방법에 대한 자세한 내용은 웹 서비스 구조화를 참조하세요.

모든 구성 요소

이 구성 파일에서 지원되는 모든 요소의 전체 목록은 app.yaml 참조를 확인하세요.