Commit f88ddbd6 by Tsubasa Namiki

A user can specify which version to install

parent 7e29b8a8
...@@ -27,6 +27,8 @@ restyaboard: ...@@ -27,6 +27,8 @@ restyaboard:
- postgres:postgres - postgres:postgres
ports: ports:
- 1234:80 - 1234:80
environment:
RESTYABOARD_VERSION: v0.1.2
volumes_from: volumes_from:
- data - data
restart: always restart: always
...@@ -12,7 +12,7 @@ COPY etc/yum.repos.d/nginx.repo /etc/yum.repos.d/ ...@@ -12,7 +12,7 @@ COPY etc/yum.repos.d/nginx.repo /etc/yum.repos.d/
# update & install package # update & install package
RUN \ RUN \
yum update -y; \ yum update -y; \
yum install -y git bzip2 cronie postfix postgresql; \ yum install -y bzip2 cronie postfix postgresql; \
yum install -y --enablerepo=nginx nginx; \ yum install -y --enablerepo=nginx nginx; \
yum install -y --enablerepo=remi-php56\ yum install -y --enablerepo=remi-php56\
php php-fpm php-pgsql php-mbstring php-pecl-imagick; \ php php-fpm php-pgsql php-mbstring php-pecl-imagick; \
...@@ -24,25 +24,13 @@ RUN \ ...@@ -24,25 +24,13 @@ RUN \
sed -i 's/^user = apache$/user = nginx/g' /etc/php-fpm.d/www.conf; \ sed -i 's/^user = apache$/user = nginx/g' /etc/php-fpm.d/www.conf; \
sed -i 's/^group = apache$/group = nginx/g' /etc/php-fpm.d/www.conf sed -i 's/^group = apache$/group = nginx/g' /etc/php-fpm.d/www.conf
# install restyaboard # remove document root
RUN \ RUN rm -rf /usr/share/nginx/html
rm -rf /usr/share/nginx/html; \
git clone https://github.com/RestyaPlatform/board.git\
/usr/share/nginx/html
WORKDIR /usr/share/nginx/html
RUN \
cp restyaboard.conf /etc/nginx/conf.d; \
cp -R media /tmp; \
npm install; \
grunt build:live; \
echo '*/5 * * * * php /usr/share/nginx/htmlserver/php/R/shell/cron.php'\
> /var/spool/cron/root
# volume # volume
VOLUME /usr/share/nginx/html/media VOLUME /usr/share/nginx/html/media
# entry point # entry point
COPY docker-entrypoint.sh / COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["start"] CMD ["start"]
...@@ -3,6 +3,17 @@ ...@@ -3,6 +3,17 @@
set -e set -e
if [ "$1" = 'start' ]; then if [ "$1" = 'start' ]; then
# provision
cd /tmp
curl -L -o restyaboard.tar.gz https://github.com/RestyaPlatform/board/archive/${RESTYABOARD_VERSION}.tar.gz
mkdir html && tar xzvf restyaboard.tar.gz -C html --strip-components 1
cp -rf html /usr/share/nginx/
cd /usr/share/nginx/html
cp restyaboard.conf /etc/nginx/conf.d
npm install
grunt build:live
echo '*/5 * * * * php /usr/share/nginx/htmlserver/php/R/shell/cron.php' > /var/spool/cron/root
# config # config
sed -i "s/^.*'R_DB_NAME'.*$/define('R_DB_NAME', 'restyaboard');/g" \ sed -i "s/^.*'R_DB_NAME'.*$/define('R_DB_NAME', 'restyaboard');/g" \
/usr/share/nginx/html/server/php/R/config.inc.php /usr/share/nginx/html/server/php/R/config.inc.php
...@@ -16,7 +27,6 @@ if [ "$1" = 'start' ]; then ...@@ -16,7 +27,6 @@ if [ "$1" = 'start' ]; then
/usr/share/nginx/html/server/php/R/config.inc.php /usr/share/nginx/html/server/php/R/config.inc.php
# media # media
cp -R /tmp/media /usr/share/nginx/html
chmod -R go+w /usr/share/nginx/html/media chmod -R go+w /usr/share/nginx/html/media
chmod -R go+w /usr/share/nginx/html/client/img chmod -R go+w /usr/share/nginx/html/client/img
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment