Created
February 12, 2018 00:30
-
-
Save ksakae1216/1652777c6cacdf86d5a14975ebe75e08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Linux OS | |
FROM centos:7 | |
# 準備 | |
RUN yum -y update | |
# nginx | |
# リポジトリ登録 | |
RUN rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm | |
# nginxインストール | |
RUN yum install -y nginx | |
# tomcat & 管理コンソール & Java 1.8 Install | |
RUN yum install -y tomcat tomcat-admin-webapps | |
# tomcatの設定(管理コンソールを使えるようにする) | |
# コメントを外す(エスケープ文字は"\"にする事、"¥"だとコマンドが失敗する) | |
RUN sed -i -e 's/.*<role rolename="admin-gui"\/>.*/<role rolename="admin-gui"\/>/' /usr/share/tomcat/conf/tomcat-users.xml | |
RUN sed -i -e 's/.*<role rolename="manager-gui"\/>.*/<role rolename="manager-gui"\/>/' /usr/share/tomcat/conf/tomcat-users.xml | |
RUN sed -i -e 's/.*<user name="admin".*/<user name="admin" password="password" roles="admin-gui,manager-gui"\/>/' /usr/share/tomcat/conf/tomcat-users.xml | |
# ポート公開 | |
EXPOSE 80 | |
EXPOSE 8080 | |
# OS起動時に自動起動(サービス起動) | |
RUN systemctl enable nginx.service | |
RUN systemctl enable tomcat.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment