자바스크립트를 활성화 해주세요

d018 Goormide 1G 무료 컨테이너에 Discourse가 설치되고 돌아갈까 시험해 보았습니다

 ·  ☕ 4 min read

Discourse는 게시판기능을 하는 어플리케이션입니다만, 고급기능이 많습니다. 무료로 사용할 수 있는 오픈 프로젝트 중에서는 꽤 고급스럽기까지 합니다.

탐이나서 설치해 보려고 했는데, 설치하는 것이 만만하지 않습니다. 좀처럼 나에게는 익숙하지 않은 종류의 어플리케이션이 설치되어져야 합니다.

또 빌드하는 것도 까다로워서 많은 문서가 Docker 이미지를 받아서 쓰라고 안내가 되고 있습니다만, GoormIDE 자체가 컨테이너인데, 컨테이너 안에서 컨테이너를 실행할 수도 없고 난처합니다.

거기에 고민은 더 있습니다. 1G면 제대로 돌아갈까요? progresql도 설치해야하고 redis도 돌아가야 하고… 돌려야 하는 어플리케이션은 이만큼 있습니다.

  • Postgres
  • Apache
  • PHP
  • Redis
  • Ruby
  • Git
  • SQLite
  • Perl
  • phppgadmin
  • Discourse

설치, 시작합니다.

컨테이너

컨테이너를 만들때 Goormide의 대쉬보드를 보면, URL이 표시되는 부분이 있습니다. 랜덤으로 만들어진 서브도메인으로 80포트를 기본으로 열어줍니다. 이 URL을 저장해 둡니다. 왜냐하면 웹어플리케이션을 실행할 때에 설정값으로 입력해야 하기 때문입니다.

d018_goormide_dashboard_url.png

그 외에는 Empty Ubuntu 18.04로 선택하면 됩니다.

Discourse 설치

우선 제일 심플한 방법을 사용했습니다. 제일 심플한 방법은 누군가가 만들어 둔 빌드 스크립트, 최근까지 잘 빌드되는지 관리가 잘 되어 있는 빌드스크릅트를 실행만 하면 그대로 만들어 지는 것을 사용하는 것이겠죠. 저는 bitnami.com에서 제공하는 스크립트를 사용했습니다.

페이지에서 빌드하고 싶은 어플리케이션을 구해서 Linux에서 움직이는 바이너리를 다운받는 방법도 있고, wget을 사용해서 다운받아도 됩니다.

버전은 최근 버전이 새로 나오면 아마도 링크가 달라질 것입니다.

wget -L https://bitnami.com/redirect/to/1114805/bitnami-discourse-2.5.0-1-linux-x64-installer.run

바이너리가 받아지면 그다음에는 이를 실행하는 것 뿐입니다. 다음의 커맨드로 실행할 수 있게 설정해서 실행합니다.

chmod +x bitnami-discourse-2.5.0-1-linux-x64-installer.run

./bitnami-discourse-2.5.0-1-linux-x64-installer.run

Discourse 빌드

실은 자세한 빌드 내용은 잘 모르고, 빌드는 저 커맨드가 다 실행해 주기 때문에 기다리기만 하면 됩니다.

물론 1기가의 컨테이너에서는 조금 인내심을 가지고 기다려야 합니다. 다행히도 블드스크립트가 퍼센테이지를 보여주기 때문에 얼마나 남았는 지 알 수 있습니다. 다음은 빌드하는 이미지 입니다.

d018_goormide_building.png

빌드시에 나오는 메세지를 살펴보면 다음과 같습니다.

root@goorm:~# wget c:\temp\bitnami-discourse-2.5.0-1-linux-x64-installer
--2020-08-27 14:24:49--  ftp://c/tempbitnami-discourse-2.5.0-1-linux-x64-installer
           => ‘tempbitnami-discourse-2.5.0-1-linux-x64-installer’
Resolving c (c)... 접속 실패: 이름 혹은 서비스를 알 수 없습니다.
wget: unable to resolve host address ‘c’
root@goorm:~# wget -L https://bitnami.com/redirect/to/1114805/bitnami-discourse-2.5.0-1-linux-x64-installer.run
--2020-08-27 14:27:15--  https://bitnami.com/redirect/to/1114805/bitnami-discourse-2.5.0-1-linux-x64-installer.run
Resolving bitnami.com (bitnami.com)... 50.17.235.25
접속 bitnami.com (bitnami.com)|50.17.235.25|:443... 접속됨.
HTTP request sent, awaiting response... 302 Found
Location: https://downloads.bitnami.com/files/stacks/discourse/2.5.0-1/bitnami-discourse-2.5.0-1-linux-x64-installer.run [following]
--2020-08-27 14:27:16--  https://downloads.bitnami.com/files/stacks/discourse/2.5.0-1/bitnami-discourse-2.5.0-1-linux-x64-installer.run
Resolving downloads.bitnami.com (downloads.bitnami.com)... 99.86.144.2, 99.86.144.34, 99.86.144.92, ...
접속 downloads.bitnami.com (downloads.bitnami.com)|99.86.144.2|:443... 접속됨.
HTTP request sent, awaiting response... 200 OK
Length: 619592496 (591M) [binary/octet-stream]
Saving to: ‘bitnami-discourse-2.5.0-1-linux-x64-installer.run’

bitnami-discourse-2.5.0-1-linux-x64- 100%[======================================================================>] 590.89M  13.1MB/s    in 47s

2020-08-27 14:28:04 (12.6 MB/s) - ‘bitnami-discourse-2.5.0-1-linux-x64-installer.run’ saved [619592496/619592496]

root@goorm:~# chmod +x bitnami-discourse-2.5.0-1-linux-x64-installer.run
root@goorm:~# ls
bitnami-discourse-2.5.0-1-linux-x64-installer.run
root@goorm:~# ./bitnami-discourse-2.5.0-1-linux-x64-installer.run
----------------------------------------------------------------------------
Welcome to the Bitnami Discourse Stack Setup Wizard.

----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.

PhpPgAdmin [Y/n] :n

Discourse : Y (Cannot be edited)

Is the selection above correct? [Y/n]:

----------------------------------------------------------------------------
Installation folder

Please, choose a folder to install Bitnami Discourse Stack

Select a folder [/opt/discourse-2.5.0-1]:

----------------------------------------------------------------------------
Create Admin account

Bitnami Discourse Stack admin user creation

Your real name [User Name]: tkim

Email Address [user@example.com]: tkiminfo@gmail.com

Login [user]: tkim

Password :
Please confirm your password :

Discourse

Please configure Discourse installation

Discourse title [tkims site!]:

Hostname that will be used to create internal URLs. If this value is incorrect,
you may be unable to access your Discourse installation from other computers.

Hostname [172.17.0.21]:

Do you want to configure mail support? [y/N]:

----------------------------------------------------------------------------
Setup is now ready to begin installing Bitnami Discourse Stack on your computer.

Do you want to continue? [Y/n]:

----------------------------------------------------------------------------
Please wait while Setup installs Bitnami Discourse Stack on your computer.

 Installing
 0% ______________ 50% ______________ 100%
 ########################################
 
Press [Enter] to continue:

goormide에서 제공하는 CPU와 메모리의 그래프를 보면 다음과 같습니다.

d018_goormide_discourse_running.png

브라우저로 URL을 접속해 봤습니다.

d018_goormide_discourse_browsing.png

잘 돌아갑니다.

서비스 기동

GoormIDE는 한참을 사용하지 않으면 자동적으로 종료가 되어버립니다.

컨테이너를 다시 실행하면 Discourse가 종료되어 있겠죠?

root@goorm:~# /opt/discourse-2.5.0-1/ctlscript.sh
usage:
/opt/discourse-2.5.0-1/ctlscript.sh help
/opt/discourse-2.5.0-1/ctlscript.sh (start|stop|restart|status)
/opt/discourse-2.5.0-1/ctlscript.sh (start|stop|restart|status) postgresql
/opt/discourse-2.5.0-1/ctlscript.sh (start|stop|restart|status) apache
/opt/discourse-2.5.0-1/ctlscript.sh (start|stop|restart|status) redis
/opt/discourse-2.5.0-1/ctlscript.sh (start|stop|restart|status) discourse_sidekiq

help       - this screen
start      - start the service(s)
stop       - stop  the service(s)
restart    - restart or start the service(s)
status     - show the status of the service(s)

root@goorm:~# /opt/discourse-2.5.0-1/ctlscript.sh start
could not change directory to "/root": Permission denied
pg_ctl.bin: another server might be running; trying to start server anyway
waiting for server to start........ done
server started
/opt/discourse-2.5.0-1/postgresql/scripts/ctl.sh : postgresql  started at port 5432
/opt/discourse-2.5.0-1/redis/scripts/ctl.sh : redis started at port 6379
/opt/discourse-2.5.0-1/apps/discourse/scripts/sidekiq.sh : discourse_sidekiq could not be started
Syntax OK
/opt/discourse-2.5.0-1/apache2/scripts/ctl.sh : httpd started at port 80
root@goorm:~#

레퍼런스

공유하기

tkim
글쓴이
tkim
Software Engineer