Skip to content

Commit

Permalink
Upgrade yona 1.0.1
Browse files Browse the repository at this point in the history
파일정리
replace 'yobi' -> 'yona'
  • Loading branch information
pokev25 committed Apr 14, 2016
1 parent 0a4669a commit eb4900b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 180 deletions.
41 changes: 18 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM debian:jessie
MAINTAINER SungKwang Song <saltfactory@gmail.com>
MAINTAINER pokev25 <pokev25@gmail.com>

LABEL Description="This image is used to start the yobi-0.8.2" Vendor="saltfactory.net" Version="0.8.2"
LABEL Description="This image is used to start the yona-1.0.1" Vendor="pokev25" Version="1.0.1"

## replace debian mirror with ftp.daum.net in Korea
RUN cd /etc/apt && \
Expand All @@ -21,36 +21,31 @@ RUN apt-get install -y unzip
## remove cache
RUN rm -rf /var/cache/oracle-jdk8-installer && apt-get clean && rm -rf /var/lib/apt/lists/*

## add yobi user
RUN useradd -m -d /yobi -s /bin/bash -U yobi
## add yona user
RUN useradd -m -d /yona -s /bin/bash -U yona

RUN mkdir /yobi/downloads
RUN mkdir /yona/downloads

#RUN cd /yobi/downloads; \
# wget http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip &&\
# unzip typesafe-activator-1.2.10-minimal.zip

## install yobi
RUN cd /yobi/downloads; \
wget https://github.com/yona-projects/yona/releases/download/v1.0.0/yobi-data-export.zip && \
unzip -d /yobi/release yobi-data-export.zip
## install yona
RUN cd /yona/downloads; \
wget https://github.com/yona-projects/yona/releases/download/v1.0.1/yona-v1.0.1-bin.zip && \
unzip -d /yona/release yona-v1.0.1-bin.zip

## set environment variables

ENV YOBI_HOME "/yobi/home"
ENV YONA_HOME "/yona/home"
ENV JAVA_OPTS "-Xmx2048m -Xms2048m"
#ENV PATH $PATH:/yobi/downloads/activator-1.2.10-minimal

## add entrypoints
ADD ./entrypoints /yobi/entrypoints
RUN chmod +x /yobi/entrypoints/*.sh
ADD ./entrypoints /yona/entrypoints
RUN chmod +x /yona/entrypoints/*.sh

## yobi home directory mount point from host to docker container
VOLUME ["/yobi/source", "/yobi/home"]
WORKDIR ["/yobi"]
## yona home directory mount point from host to docker container
VOLUME ["/yona/source", "/yona/home"]
WORKDIR ["/yona"]

## yobi service port expose from docker container to host
## yona service port expose from docker container to host
EXPOSE 9000

## run yobi command
ENTRYPOINT ["/yobi/entrypoints/bootstrap.sh"]
## run yona command
ENTRYPOINT ["/yona/entrypoints/bootstrap.sh"]
6 changes: 3 additions & 3 deletions entrypoints/before.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

if [ -f "$YOBI_HOME/RUNNING_PID" ];then
rm $YOBI_HOME/RUNNING_PID
echo "*** [rm] $YOBI_HOME/RUNNING_PID ***"
if [ -f "$YONA_HOME/RUNNING_PID" ];then
rm $YONA_HOME/RUNNING_PID
echo "*** [rm] $YONA_HOME/RUNNING_PID ***"
fi
20 changes: 10 additions & 10 deletions entrypoints/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#!/bin/bash
set -e

# cd /yobi/home; activator "start -DapplyEvolutions.default=true -Dhttp.port=9000"
# cd /yona/home; activator "start -DapplyEvolutions.default=true -Dhttp.port=9000"

if [ -n "$BEFORE_SCRIPT" ]; then
set +e
echo "*** [RUN BEFORE_SCRIPT] ***"
chmod +x /yobi/entrypoints/$BEFORE_SCRIPT
/bin/bash /yobi/entrypoints/$BEFORE_SCRIPT
chmod +x /yona/entrypoints/$BEFORE_SCRIPT
/bin/bash /yona/entrypoints/$BEFORE_SCRIPT
echo "*** [DONE BEFORE_SCRIPT] ***"
set -e
fi

## if source files from volume, replace home with sources, files volume only used when it's not source build.
if [ -n "$(ls -A /yobi/source)" ]; then
mv /yobi/release /yobi/release.bak
ln -s /yobi/source /yobi/release
echo "*** Straing container yobi source... ***"
cd /yobi/release; activator "start -DapplyEvolutions.default=true -Dhttp.port=9000"
if [ -n "$(ls -A /yona/source)" ]; then
mv /yona/release /yona/release.bak
ln -s /yona/source /yona/release
echo "*** Straing container yona source... ***"
cd /yona/release; activator "start -DapplyEvolutions.default=true -Dhttp.port=9000"
else
echo "*** Straing container yobi bin ... ***"
cd /yobi/release/yobi-0.8.2; bin/yobi
echo "*** Straing container yona bin ... ***"
cd /yona/release/yona-1.0.1; bin/yona
fi


Expand Down
14 changes: 6 additions & 8 deletions shell/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@

############################################################
## docker project name
PROJECT_NAME="docker-yobi"
PROJECT_NAME="docker-yona"
############################################################
## docker configurations
DOCKER_USER="saltfactory"
DOCKER_VERSION="0.8.2"
DOCKER_NAME="yobi"
DOCKER_USER="pokev25"
DOCKER_VERSION="1.0.1"
DOCKER_NAME="yona"
DOCKER_IMAGE="$DOCKER_USER/$DOCKER_NAME:$DOCKER_VERSION"
############################################################
## container configurations
DOCKER_CONTAINER_NAME="yobi"
DOCKER_CONTAINER_NAME="yona"
DOCKER_CONTAINER_PORT="9000"
############################################################
## container volumes, if you want to install full package, you must remove YOBI_SOURCE.
#YOBI_SOURCE="/Users/saltfactory/shared/yobi-0.8.2"
# YOBI_HOME="/Users/saltfactory/shared/yobi-home"
# YONA_HOME="/home/user/yona-home"
JAVA_OPT="-Xmx1024m -Xms1024m"
############################################################
136 changes: 0 additions & 136 deletions shell/yobi.sh

This file was deleted.

0 comments on commit eb4900b

Please sign in to comment.