# Docker-Compose 를 이용하여 Yona 사용하기

{% embed url="<https://paypal.me/shop2002>" %}
donation
{% endembed %}

{% hint style="info" %}
**2022년 NHN Cloud&#x20;**<mark style="color:red;">**무료**</mark>**&#x20;교육일정** : <https://doc.skill.or.kr/2022-NHN-Cloud-Education>
{% endhint %}

{% hint style="warning" %}
**2022년 NHN Cloud&#x20;**<mark style="color:red;">**행사/프로모션**</mark>**&#x20;정보 공유** : <https://doc.skill.or.kr/2022-NHN-Cloud-Event-Promotion>
{% endhint %}

## 1. Yona Project 란 무엇인가?    &#x20;

> #### &#x20;Yona 는 21세기 협업 개발 플랫폼입니다.
>
> * Git 저장소 기능이 내장된 설치형 이슈트래커
> * Naver, Naver Labs 를 비롯하여 게임회사, 통신회사 고객센터, 공공기관, 투자사, 학교, 기업등에서 수년 간 실제로 사용되어 왔고 개선되어 온(Real world battled) 애플리케이션입니다.   &#x20;

{% hint style="info" %}
자세한 사항은 [Yona-Project](https://github.com/yona-projects/yona) 에서 확인 하시기 바랍니다.&#x20;
{% endhint %}

## 2. Yona 의 주요기능은?

> * 서비스 종료나 데이터 종속 걱정없는 설치형
> * 프로젝트 기반의 유연한 이슈트래커와 게시판
>   * 편리한 프로젝트간 이슈 이동
>   * 서브 태스크 이슈
>   * 본문 변경이력 보기
>   * 이슈 템플릿 기능
> * 자체 내장된 코드 저장소
>   * Git/SVN 선택 가능
>   * 온라인 수정 및 커밋 지원
>   * 프로젝트 멤버만 코드에 접근 가능 기능 등
> * 블럭기반 코드리뷰
>   * 코드 블럭 및 리뷰 스레드 지원
>   * 리뷰 점수 지원
> * 그룹 기능
>   * 그룹 이슈 및 게시글 통합관리
>   * 그룹 프로젝트, 그룹 멤버
> * 한글 기반
>   * 프로젝트 이름 및 그룹 이름에 한글을 사용가능
> * LDAP 지원
>   * LDAP 장애시에도 사용가능한 기능 제공
> * 다른 제품이나 서비스로의 마이그레이션 기능 제공
>   * Github/Github Enterprise, 또 다른 Yona 인스턴스, Redmine 등
> * 로그인 관련 보안을 높일 수 있는 소셜로그인 지원

{% hint style="info" %}
자세한 사항은 [Yona-Project](https://github.com/yona-projects/yona) 에서 확인 하시기 바랍니다.&#x20;
{% endhint %}

## 3. Yona 의 라이센스는?

> Yona는 Apache 2.0 라이선스로 제공됩니다.

{% hint style="info" %}
자세한 사항은 [Yona-Project](https://github.com/yona-projects/yona) 에서 확인 하시기 바랍니다.&#x20;
{% endhint %}

## 4. dockerfile을 이용하여 만들어 보자!!!

### 4.1 서비스 설계 구성         &#x20;

| 구성                    | 설명                                                                                   |
| --------------------- | ------------------------------------------------------------------------------------ |
| Docker Hub Base Image | mariadb:10.3                                                                         |
| Source                | <https://github.com/yona-projects/yona>                                              |
| Install Files         | <https://github.com/yona-projects/yona/releases/download/v1.4.0/yona-v1.4.0-bin.zip> |
| Service Port          | 9000                                                                                 |

### 4.2 파일 구성   &#x20;

| 메인 폴더        | 파일                 | 설명                                                                                                                            |
| ------------ | ------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| yona-project |                    |                                                                                                                               |
|              | dockerfile         | dockerfile 설정 파일                                                                                                              |
|              | docker-compose.yml | docker-compose 실행 파일                                                                                                          |
|              | my.cnf             | mariadb 의 my.cnf 설정 파일                                                                                                        |
|              | db\_user.sql       | <p>DB User 사용자 생성 및 권한 설정    <br>비밀번호 변경이 필요 함.  </p><p>/yona/conf/application.conf 파일의 <br>maraidb 접속 ID/Password 를 수정  </p> |

> DB User 비밀번호 변경 시 아래의 값을 수정 하여야 합니다.
>
> `application.con 파일은 yona 를 처음 실행 해야 파일이 생성 됩니다.`
>
> 경로 /yona/conf/application.conf 파일
>
> {% code title="/yona/conf/application.conf" %}
>
> ```
> ...
> db.default.driver=org.mariadb.jdbc.Driver
> db.default.url="jdbc:mariadb://127.0.0.1:3306/yona?useServerPrepStmts=true"
> db.default.user=yona
> db.default.password="yonadan"
> ...
> ```
>
> {% endcode %}

{% file src="<https://674794822-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXjvaK4Gw77FbwOuHWJ%2F-MfVBmdFodCw4gzx3gUQ%2F-MfVCbbCUbu1IgcHrvzN%2Fyona-project.zip?alt=media&token=4067cf65-7e15-4cf2-b500-09953e68b290>" %}

### 4.3 DockerFile 을 이용하여 Docker Images 만들기&#x20;

{% code title="dockerfile " %}

```
### Base Image 지정
FROM mariadb:10.3

### TimeZone 환경 변수 지정
ENV TZ Asia/Seoul

### Mariadb root 비밀번호 설정
ENV MYSQL_ROOT_PASSWORD=root

### TimeZone 설정   
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

### 업데이트    
RUN apt update && apt -y install git vim wget openjdk-8-jdk unzip

### yona 및 mysql 설정파일   
RUN mkdir /yona-data
COPY my.cnf /etc/mysql/my.cnf

### yona 설치 파일 다운로드 및 압축 해제   
RUN wget https://github.com/yona-projects/yona/releases/download/v1.4.0/yona-v1.4.0-bin.zip
RUN unzip yona-v1.4.0-bin.zip
RUN mv yona-1.4.0 yona

### DB User 생성 및 권한 설정
ADD db_user.sql /docker-entrypoint-initdb.d/db_user.sql

WORKDIR /yona

EXPOSE 9000
```

{% endcode %}

{% file src="<https://674794822-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXjvaK4Gw77FbwOuHWJ%2F-MfKkM9fkqRwm6OJ3c2L%2F-MfKkYqOrgIAj1tMSJH7%2Fdockerfile.zip?alt=media&token=5b7408ba-0f32-403a-a99d-c2bc5ed56cad>" %}

### 4.4 DockerFile Build 하기   &#x20;

{% code title="dockerfile 을 build 하여 docker image 만들기" %}

```
$ docker build -t tomcat_mariadb:yona-v.1.4.0 .
[+] Building 0.2s (15/15) FINISHED
 => [internal] load build definition from Dockerfile                                                                      0.0s
 => => transferring dockerfile: 552B                                                                                      0.0s
 => [internal] load .dockerignore                                                                                         0.0s
 => => transferring context: 2B                                                                                           0.0s
 => [internal] load metadata for docker.io/library/mariadb:10.3                                                           0.0s
 => [ 1/10] FROM docker.io/library/mariadb:10.3                                                                           0.0s
 => [internal] load build context                                                                                         0.0s
 => => transferring context: 59B                                                                                          0.0s
 => CACHED [ 2/10] RUN ln -snf /usr/share/zoneinfo/Asia/Seoul /etc/localtime && echo Asia/Seoul > /etc/timezone           0.0s
 => CACHED [ 3/10] RUN apt update && apt -y install git vim wget openjdk-8-jdk unzip                                      0.0s
 => CACHED [ 4/10] RUN mkdir /yona-data                                                                                   0.0s
 => CACHED [ 5/10] COPY my.cnf /etc/mysql/my.cnf                                                                          0.0s
 => CACHED [ 6/10] RUN wget https://github.com/yona-projects/yona/releases/download/v1.4.0/yona-v1.4.0-bin.zip            0.0s
 => CACHED [ 7/10] RUN unzip yona-v1.4.0-bin.zip                                                                          0.0s
 => CACHED [ 8/10] RUN mv yona-1.4.0 yona                                                                                 0.0s
 => CACHED [ 9/10] ADD db_user.sql /docker-entrypoint-initdb.d/db_user.sql                                                0.0s
 => CACHED [10/10] WORKDIR /yona                                                                                          0.0s
 => exporting to image                                                                                                    0.1s
 => => exporting layers                                                                                                   0.0s
 => => writing image sha256:66a6be3fde0d4a31fdbe18a57a2283e75cb858f16e3edf929295ae141d220c80                              0.0s
 => => naming to docker.io/library/tomcat_mariadb:yona-v.1.4.0                                                                      0.0s
Authenticating with existing credentials...
Login Succeeded
```

{% endcode %}

### 4.5 Build Image 를 이용하여 실행 해 보기   &#x20;

```
### Local docker images 검색   
$ docker images | findstr yona
bchwang/tomcat_mariadb                          yona-v.1.4.0          66a6be3fde0d   16 hours ago    1.24GB

### docker 실행하기 
$ docker run -d -p 80:900 tomcat_mariadb:yona-v.1.4.0
3d3811e3e7635545f0875e28f15cf79e128855b9c07ed07e0d59f8cd73bd58e3

### 실행된 docker 확인 
$ docker ps
CONTAINER ID   IMAGE               COMMAND                  CREATED                  STATUS         PORTS                                             NAMES
3d3811e3e763   yona-project:yona   "docker-entrypoint.s…"   Less than a second ago   Up 3 seconds   3306/tcp, 0.0.0.0:80->9000/tcp, :::80->9000/tcp   determined_moore

### 실행된 Container 에 접속 하기     
$ docker exec -it 3d3811e3e763 /bin/bash
root@3d3811e3e763:/yona/bin# ls
yona  yona.bat

### 실행된 Container 에 접속 하여 yona 실행 하기       
root@3d3811e3e763:/yona/bin# ./yona     ## ./yona & [백그라운드 실행]
Play server process ID is 213
[info] play - database [default] connected at jdbc:mysql://127.0.0.1:3306/yona
[info] play - Starting application default Akka system.
[debug] application - Registered AuthProvider 'google'
[debug] application - Registered AuthProvider 'github'
[info] play - Application started (Prod)
[info] application - User uploaded temporary files are cleaned up...(0 of 0)
[info] play - Listening for HTTP on /0.0.0.0:9000
```

## 5. Docker Hub 에 이미지 업로드  &#x20;

### 5.1 Docker push 를 이용하여 업로드 &#x20;

{% code title="docker push 를 이용하여 업로드" %}

```
### docker image tag 설정 
$ docker tag tomcat_mariadb:yona-v.1.4.0 bchwang/tomcat_mariadb:yona-v.1.4.0

### docker push 를 이용하여 업로드    
$ docker push bchwang/tomcat_mariadb:yona-v.1.4.0
The push refers to repository [docker.io/bchwang/tomcat_mariadb]
5f70bf18a086: Layer already exists
6921f1ef6bdd: Layer already exists
4679a8f17301: Pushed
b9bd63f53b44: Pushed
2834b665eb52: Pushed
e69d19316294: Layer already exists
3bff3ec352d8: Layer already exists
e9cf36b34289: Pushed
c4c2468cd25c: Layer already exists
791a7442f3ff: Layer already exists
19c8780ee26f: Layer already exists
4b9f2147a623: Layer already exists
337e89027ad2: Layer already exists
956b4f80a078: Layer already exists
df8b8ee18301: Layer already exists
7e50f83cc60c: Layer already exists
b98c96f5ae6b: Layer already exists
b699e149afa6: Layer already exists
0552d4cbc6e9: Layer already exists
a70daca533d0: Layer already exists
yona-v.1.4.0: digest: sha256:95eb1ac4fe0f6221aa008429cdd4e1da1003d364ad11695ad1feaa10f91e3564 size: 4504
```

{% endcode %}

### 5.2 Docker hub 에 접속 하여 업로드 된 이미지 확인

![그림. Docker Hub 사이트 접속 화면](https://674794822-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXjvaK4Gw77FbwOuHWJ%2F-MfM8jkbCv80ZSP8cA4H%2F-MfMF7vwQ7rO6R5suVvP%2Fimage.png?alt=media\&token=ebfafaa6-5ba5-4a79-8610-8e646ad266f5)

## 6. Yona-Project 실행 하기  &#x20;

### 6.1 Docker-Compose.yml 설정 하기      &#x20;

{% code title="docker-compose.yml 파일" %}

```
version: '3.1'

services:

  yona:
    image: bchwang/tomcat_mariadb:yona-v.1.4.0
    restart: always
    ports:
      - 80:9000
```

{% endcode %}

{% file src="<https://674794822-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXjvaK4Gw77FbwOuHWJ%2F-MfVBmdFodCw4gzx3gUQ%2F-MfVCYs6J4r3sg2WTpoW%2Fdocker-compose.yml?alt=media&token=6212d50e-e505-4db9-bdb8-c666feae67a8>" %}

### 6.2 웹 접속 하여 Admin 설정 하기    &#x20;

> 크롬을 통해 웹사이트에 접속 하여 Admin 의 비밀번호를 설정 한 후 다시 한번 yona 를 재시작 하고 Admin 으로 로그인 하고 사용 하면 됩니다.   &#x20;

```
### docker-compose.yml 실행   
$ docker-compose up -d
Starting yona_redmine_1 ... done

### 실행된 docker 확인 
$ docker ps
CONTAINER ID   IMAGE               COMMAND                  CREATED                  STATUS         PORTS                                             NAMES
3d3811e3e763   yona-project:yona   "docker-entrypoint.s…"   Less than a second ago   Up 3 seconds   3306/tcp, 0.0.0.0:80->9000/tcp, :::80->9000/tcp   determined_moore

### 실행된 Container 에 접속 하기     
$ docker exec -it 3d3811e3e763 /bin/bash
root@3d3811e3e763:/yona/bin# ls
yona  yona.bat

### 초 yona 실행 하기       
root@3d3811e3e763:/yona/bin# ./yona     ## ./yona & [백그라운드 실행]
Play server process ID is 213
[info] play - database [default] connected at jdbc:mysql://127.0.0.1:3306/yona
[info] play - Starting application default Akka system.
[debug] application - Registered AuthProvider 'google'
[debug] application - Registered AuthProvider 'github'
[info] play - Application started (Prod)
[info] application - User uploaded temporary files are cleaned up...(0 of 0)
[info] play - Listening for HTTP on /0.0.0.0:9000

### Admin 비밀번호 번경 후 yona 재시작 하기    
root@3d3811e3e763:/yona/bin# ./yona     ## ./yona & [백그라운드 실행]
Play server process ID is 213
[info] play - database [default] connected at jdbc:mysql://127.0.0.1:3306/yona
[info] play - Starting application default Akka system.
[debug] application - Registered AuthProvider 'google'
[debug] application - Registered AuthProvider 'github'
[info] play - Application started (Prod)
[info] application - User uploaded temporary files are cleaned up...(0 of 0)
[info] play - Listening for HTTP on /0.0.0.0:9000
```

![그림. 초기 접속 후 Admin 접속 정보 변경 후 yona 재시작 필요     ](https://674794822-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXjvaK4Gw77FbwOuHWJ%2F-MfKpJ8UluoB_nYzR93y%2F-MfM8bXpDILe6azju7qu%2Fimage.png?alt=media\&token=f73c918f-1208-4ae8-ae3a-8bcdbde12d09)

![그림. Admin 설정 후 yona 화면   ](https://674794822-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXjvaK4Gw77FbwOuHWJ%2F-MfVAK3yRAEu6r5r6C0R%2F-MfVBcbce-_RLfuPxKnk%2Fimage.png?alt=media\&token=3b5938d8-d9f1-481b-90c1-c1f0670bfe7d)

## 7. Yona-Project 에서 yona 설치 방법   &#x20;

> Yona 는 다음과 같은 2단계로 설치를 진행 합니다.

### 7.1 MariaDB 설치    &#x20;

> 자세한 사항은 홈페이지를 참고 하시기 바랍니다. [바로가기](https://github.com/yona-projects/yona/blob/next/docs/ko/install-mariadb.md)      &#x20;

### 7.2 Yona 설치  &#x20;

> 자세한 사항은 홈페이지를 참고 하시기 바랍니다. [바로가기](https://github.com/yona-projects/yona/blob/next/docs/ko/install-yona-server.md)    &#x20;

## 8 . 그 밖의 사항(Yona 실행 및 업그레이드/백업 및 복구/문제 해결)

> 그 밖에 사항에 대해서는 홈페이지를 참고 하시기 바랍니다. [바로가기](https://github.com/yona-projects/yona#yona-%EC%8B%A4%ED%96%89-%EB%B0%8F-%EC%97%85%EA%B7%B8%EB%A0%88%EC%9D%B4%EB%93%9C%EB%B0%B1%EC%97%85-%EB%B0%8F-%EB%B3%B5%EA%B5%AC%EB%AC%B8%EC%A0%9C-%ED%95%B4%EA%B2%B0)        &#x20;

{% hint style="info" %}
**2022년 NHN Cloud&#x20;**<mark style="color:red;">**무료**</mark>**&#x20;교육일정** : <https://doc.skill.or.kr/2022-NHN-Cloud-Education>
{% endhint %}

{% hint style="warning" %}
**2022년 NHN Cloud&#x20;**<mark style="color:red;">**행사/프로모션**</mark>**&#x20;정보 공유** : <https://doc.skill.or.kr/2022-NHN-Cloud-Event-Promotion>
{% endhint %}

{% embed url="<https://paypal.me/shop2002>" %}
donation
{% endembed %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.skill.or.kr/docker-yona.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
