FROM centos:8
MAINTAINER Donfig <choi.jh@idcjp.jp>

# My comment here
RUN echo '1. Base packages install'
RUN dnf install -y epel-release net-tools wget git openssl vim glibc-langpack-ko systemd bind-utils
RUN dnf -y install  https://rpms.remirepo.net/enterprise/remi-release-8.rpm
RUN dnf -y update; dnf clean all
RUN dnf makecache

RUN echo '2. Locale and Timezone environment'
ENV LANG ko_KR.utf8
RUN echo 'LANG="$LANG"' > /etc/locale.conf
RUN unlink /etc/localtime
RUN ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

RUN echo 'export LANG="$LANG"' >> /etc/bashrc
RUN echo 'export LANGUAGE="$LANG"' >> /etc/bashrc
RUN source /etc/bashrc

RUN echo '3. VI environment'
RUN echo 'set encoding=utf-8' >> /etc/vimrc
RUN echo 'set encoding=utf-8' >> /etc/virc
RUN echo 'set fileencodings=utf-8,cp949' >> /etc/vimrc
RUN echo 'set fileencodings=utf-8,cp949' >> /etc/virc
RUN echo 'set softtabstop=4' >> /etc/vimrc
RUN echo 'set softtabstop=4' >> /etc/virc
RUN echo 'set shiftwidth=4' >> /etc/vimrc
RUN echo 'set shiftwidth=4' >> /etc/virc
RUN echo 'set tabstop=4' >> /etc/vimrc
RUN echo 'set tabstop=4' >> /etc/virc
RUN echo 'set paste' >> /etc/vimrc
RUN echo 'set paste' >> /etc/virc

RUN echo 'export LANG="$LANG"' >> /etc/bashrc
RUN echo 'export LANGUAGE="$LANG"' >> /etc/bashrc
RUN source /etc/bashrc

RUN echo '2. Install need Package'
RUN dnf module reset php -y
RUN dnf module enable php:7.4 -y
RUN dnf -y install zip libzip php php-bcmath php-cli php-common php-fpm php-gd php-intl php-json php-mbstring php-mysqlnd php-opcache php-pdo php-xml php-pecl-xdebug php-pecl-zip php-pecl-apcu php-snmp
RUN dnf -y install mariadb nginx net-snmp-utils supervisor

RUN echo '3. Setting Supervisor for Web'
COPY  supervisord.conf /etc/supervisord.conf

EXPOSE 80
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
