Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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
You can’t perform that action at this time.