아래 글에 youngcart를 넣기 정보
아래 글에 youngcart를 넣기본문
첨부 파일을 풀고...
docker build -t sir/yc . 로 이미지를 만듭니다.
참조: 아래글에 있던 dockerfile에 http://sir.kr/so_app/1418 에 있는 영카트 관련 파트를 넣었습니다.
몇가지 sed관련도 수정했습니다.
docker run -ti -u root -p 8080:80 sir/yc /bin/bash
로 실행해서 위의 Dockerfile의 커맨드가 제대로 동작되어 있는지 확인하고 (잘못되었으면 Dockerfile을 수정하시고..)
/usr/bin/supervisord & 백그라운드로 실행시켜서 동작되는 지 체크 해 볼수 있습니다.
지우고 새로 만들고 귀찮으신 분은 수정된 이미지를 commit으로 새로 이미지를 만드시면 됩니다.
docker commit [컨테이너] sir/yc1
아래글 내용에 보면 -v로 되어 있는데.. Volume명령어로 host의 디렉토리를 share할 수 있게 만드는 것입니다. 영카트에서는 이미 html파일을 카피했기 때문에 -v 옵션은 별 필요가 없을 것 같습니다.
(추가로 영카트 테마등을 추가할 때 사용??)
docker run -d -p 8080:80 -v `pwd`:/var/www/html:Z -v `pwd`/database:/var/lib/phpMyAdmin/upload:Z -t sir/yc
docker run -d -p 8080:80 -t sir/yc 로 실행
그럼 localhost:8080/phpmyadmin 으로 접속해서..
database > create database 에서..
database name에 원하는 것을 넣고.. Collation에 utf8mb4_general_ci (제가 쓰는 것..) create를 누른후에..
localhost:8080을 접속하면 그누보드 설치하기가 나옵니다. 순서대로 위의 정보를 넣으면...(sql은 id가 root이고 패스워드는 없습니다.)
아래와 같이 나옵니다.
Dockerfile
FROM centos:latest
MAINTAINER J
# update
RUN yum -y update
# Install varioius utilities
RUN yum -y install curl wget unzip git vim nano \
iproute python-setuptools hostname inotify-tools yum-utils which \
epel-release
# Install Python and Supervisor
RUN yum -y install python-setuptools \
&& mkdir -p /var/log/supervisor \
&& easy_install supervisor
# Install Apache
RUN yum -y install httpd
# Install Remi Updated PHP 7
RUN wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm \
&& rpm -Uvh remi-release-7.rpm \
&& yum-config-manager --enable remi-php70 \
&& yum -y install php php-devel php-gd php-pdo php-soap php-xmlrpc php-xml php-phpunit-PHPUnit
# Reconfigure Apache
RUN sed -i 's/AllowOverride None/AllowOverride All/g' /etc/httpd/conf/httpd.conf
# Install phpMyAdmin
RUN yum install -y phpMyAdmin \
&& sed -i 's/Require ip 127.0.0.1//g' /etc/httpd/conf.d/phpMyAdmin.conf \
&& sed -i 's/Require ip ::1/Require all granted/g' /etc/httpd/conf.d/phpMyAdmin.conf \
&& sed -i 's/Allow from 127.0.0.1/Allow from all/g' /etc/httpd/conf.d/phpMyAdmin.conf \
&& sed -i "s/'cookie'/'config'/g" /etc/phpMyAdmin/config.inc.php \
&& sed -i "s/\['user'\] .*= '';/\['user'\] = 'root';/g" /etc/phpMyAdmin/config.inc.php \
&& sed -i "/AllowNoPassword.*/ {N; /= FALSE/ {N; s/= FALSE/= TRUE/g}}" /etc/phpMyAdmin/config.inc.php \
&& sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 512M/g' /etc/php.ini \
&& sed -i 's/post_max_size = 8M/post_max_size = 512M/g' /etc/php.ini \
&& sed -i 's/memory_limit = 128M/memory_limit = 512M/g' /etc/php.ini \
&& sed -i 's/^/#/g' /etc/httpd/conf.d/welcome.conf
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install MariaDB
COPY MariaDB.repo /etc/yum.repos.d/MariaDB.repo
RUN yum clean all;yum -y install mariadb-server mariadb-client
VOLUME /var/lib/mysql
EXPOSE 3306
# Setup NodeJS
RUN curl --silent --location https://rpm.nodesource.com/setup_7.x | bash - \
&& yum -y install nodejs gcc-c++ make \
&& npm install -g npm \
&& npm install -g gulp grunt-cli
# UTC Timezone & Networking
RUN ln -sf /usr/share/zoneinfo/UTC /etc/localtime \
&& echo "NETWORKING=yes" > /etc/sysconfig/network
RUN adduser www-data
RUN git clone --branch master https://github.com/gnuboard/youngcart5.git /tmp/youngcart5 && \
mv /tmp/youngcart5/* /var/www/html && \
rm -rf /tmp/youngcart5 && \
chown -R www-data:www-data /var/www/html && \
mkdir /var/www/html/data && chmod 0707 -R /var/www/html/data
COPY supervisord.conf /etc/supervisord.conf
EXPOSE 80
EXPOSE 443
CMD ["/usr/bin/supervisord"]
MariaDB.repo
# MariaDB 10.1 CentOS repository list - created 2016-04-11 18:55 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock
[supervisord]
nodaemon=true
[program:mariadb]
command=/usr/bin/mysqld_safe
[program:httpd]
command=/usr/bin/pidproxy /var/run/httpd.pid /bin/bash -c "/usr/sbin/httpd -DFOREGROUND -k start"
redirect_stderr=true
[group:allservices]
programs=mariadb,httpd
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
To Do:
Theme 카피 하기
데모 DB자동으로 카피하기
0
댓글 0개