1main.go
플랫폼이 PORT 환경 변수(기본 8080)를 넣습니다. 앱은 0.0.0.0:$PORT 에서 들어야 합니다.
gofunc main() { port := os.Getenv("PORT") if port == "" { port = "8080" } http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello OneCloud")) }) log.Fatal(http.ListenAndServe(":"+port, nil)) }2배포 방법 (셋 중 하나)
① GitHub 연결: 프로젝트 → 서비스 추가 → GitHub 저장소 (push 하면 자동 배포) ② 이 폴더 그대로: oc up --wait (Dockerfile 이 없어도 언어를 감지해 빌드) ③ 콘솔에서 폴더 · zip 올리기: 서비스 추가 → 소스 올리기
bashoc login oc project create my-app --link oc up --wait