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