picture
  1. 배포

설정 파일을 통한 배포

1. 배포파일 작성하기

아래 내용을 .cloudtype/app.yaml 파일로 생성하세요.

name: myapp
app: node@16
options:
git:
branch: main
url: https://github.com/cloudtype-examples/node-express.git
env:
- name: NODE_ENV
value: production
install: npm ci --production
ports: 3000
start: npm start

2. 배포하기

아래와 같이 인수가 없는 경우 .cloudtype/app.yaml 파일을 사용하여 배포됩니다.

$ ctype apply
1 apps deployed to @demo/myproject
└ app "node" deployed to stage main

배포할 설정 파일을 지정하려는 경우 파일명을 직접 지정할 수 있습니다.

$ ctype apply -f myapp.yaml

3. 배포 확인

$ ctype ls
Current stage is "@demo/myproject:main"
NAME APP CREATED UPDATED
node node@16 2022-01-11 03:57:37 2022-01-12 20:35:56

프리셋

프리셋을 통해 설정 파일 생성하기

제공하는 플랫폼별 프리셋으로 설정 파일을 생성할 수 있습니다.

1. 프리셋 조회

$ ctype presets
58 presets found.
NAME DISPLAY NAME EXAMPLE
react React https://github.com/cloudtype-examples/react.git
vue-2 Vue 2 https://github.com/cloudtype-examples/vue2.git
vue-3 Vue 3 https://github.com/cloudtype-examples/vue3.git
angular Angular https://github.com/cloudtype-examples/angular.git
html HTML https://github.com/cloudtype-examples/html.git
gatsby Gatsby https://github.com/cloudtype-examples/gatsby.git
svelte Svelte https://github.com/cloudtype-examples/svelte.git
astro Astro https://github.com/cloudtype-examples/astro.git
lit-element-vite Lit (vite) https://github.com/cloudtype-examples/lit.git
preact-vite Preact (vite) https://github.com/cloudtype-examples/preact.git
react-vite React (vite) https://github.com/cloudtype-examples/react-vite.git
svelte-vite Svelte (vite) https://github.com/cloudtype-examples/svelte-vite.git
vanilla-vite VanillaJS (vite) https://github.com/cloudtype-examples/vanilla.git
webpack-5 Webpack 5 https://github.com/cloudtype-examples/webpack5.git
node Node.js https://github.com/cloudtype-examples/node-express.git
next.js-11 Next.js 11 https://github.com/cloudtype-examples/nextjs.git
next.js-12 Next.js 12 https://github.com/cloudtype-examples/nextjs12.git
next.js Next.js 13 https://github.com/cloudtype-examples/nextjs13.git
nuxt.js Nuxt.js https://github.com/cloudtype-examples/nuxtjs.git
nest.js NestJS https://github.com/cloudtype-examples/nestjs.git
remix Remix https://github.com/cloudtype-examples/remix.git
express-graphql GraphQL(express) https://github.com/cloudtype-examples/express-graphql
next-prisma Prisma(Next 13) https://github.com/cloudtype-examples/next-prisma.git
fastify Fastify https://github.com/cloudtype-examples/fastify.git
python-django Python Django https://github.com/cloudtype-examples/python-django.git
python-flask Python Flask https://github.com/cloudtype-examples/flask.git
python-fastapi Python FastAPI https://github.com/cloudtype-examples/fastapi.git
python-streamlit Python Streamlit https://github.com/cloudtype-examples/streamlit.git
java-springboot Spring Boot https://github.com/cloudtype-examples/java-springboot.git
kotlin Kotlin https://github.com/cloudtype-examples/kotlin.git
dotnet .NET https://github.com/cloudtype-examples/dotnet.git
golang Go https://github.com/cloudtype-examples/golang.git
gin gin https://github.com/cloudtype-examples/gin.git
fiber Fiber https://github.com/cloudtype-examples/go-fiber.git
deno Deno https://github.com/cloudtype-examples/deno.git
php PHP https://github.com/cloudtype-examples/php.git
ruby-rails Ruby on Rails https://github.com/cloudtype-examples/ruby-on-rails.git
ruby-sinatra Ruby Sinatra https://github.com/cloudtype-examples/ruby-sinatra.git
buildpacks Buildpacks https://github.com/cloudtype/example-node-express.git
container Container
dockerfile Dockerfile https://github.com/cloudtype-examples/dockerfile.git
mariadb MariaDB
mongo MongoDB
postgresql PostgreSQL
redis Redis
code-server Code Server
elasticsearch Elasticsearch
kafka Apache Kafka
nginx nginx
select Select Admin https://github.com/cloudtype/example-select.git
discordbot-js Discord Bot(JS) https://github.com/cloudtype-examples/discordbot-js.git
discordbot-py Discord Bot(Python) https://github.com/cloudtype-examples/discordbot-py.git
slackbot-js Slack Bot(JS) https://github.com/cloudtype-examples/slackbot-js.git
slackbot-py Slack Bot(Python) https://github.com/cloudtype-examples/slackbot-py.git
ghost ghost
jekyll Jekyll https://github.com/cloudtype/example-jekyll.git
wordpress Wordpress
docusaurus Docusaurus https://github.com/cloudtype-examples/example-docusaurus.git

2. 설정 파일 생성하기

원하는 프리셋 이름으로 설정 파일을 생성하세요.
파일을 지정하지 않은 경우 .cloudtype/app.yaml 파일로 생성됩니다.

$ ctype create node/express
Configuration file created. .cloudtype/app.yaml

배포하기

$ ctype apply
1 apps deployed to @demo/myproject
└ app "node" deployed to stage main

-f(--file) 옵션을 사용해서 원하는 파일명을 지정할 수 있습니다.
아래 예시는 config/myapp.yaml 파일로 생성합니다.

$ ctype create node/express -f config/myapp.yaml
Configuration file created. config/myapp.yaml

배포하기

$ ctype apply -f config/myapp.yaml
1 apps deployed to @demo/myproject
└ app "node" deployed to stage main
사용에 문제나 어려움이 있다면 디스코드 채널에서 문의하세요.
디스코드 링크