mirror of
https://github.com/chatopera/cosin.git
synced 2025-08-01 16:38:02 +08:00
#170 使用tomcat slim image
This commit is contained in:
parent
797689eee8
commit
99e9272f17
@ -1,4 +1,5 @@
|
|||||||
./app/target/
|
app/target
|
||||||
./logs/
|
!app/target/contact-center-*.war.original
|
||||||
./tmp/
|
logs/
|
||||||
./data/
|
tmp/
|
||||||
|
data/
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM chatopera/java:1.0.0
|
FROM tomcat:8.5.35-slim
|
||||||
MAINTAINER Hai Liang Wang <hain@chatopera.com>
|
MAINTAINER Hai Liang Wang <hain@chatopera.com>
|
||||||
|
|
||||||
ARG VCS_REF
|
ARG VCS_REF
|
||||||
@ -20,25 +20,12 @@ ENV LANG C.UTF-8
|
|||||||
ENV LANGUAGE en_US:en
|
ENV LANGUAGE en_US:en
|
||||||
ENV LC_ALL C.UTF-8
|
ENV LC_ALL C.UTF-8
|
||||||
|
|
||||||
|
|
||||||
# set ENVs
|
|
||||||
ENV JAVA_HOME=/opt/java-8-oracle
|
|
||||||
ENV MAVEN_HOME=/opt/apache-maven
|
|
||||||
ENV TOMCAT_HOME=/opt/apache-tomcat
|
|
||||||
ENV PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin
|
|
||||||
|
|
||||||
# create dirs
|
# create dirs
|
||||||
RUN /bin/bash -c "mkdir -p /{data,logs}"
|
RUN /bin/bash -c "mkdir -p /{data,logs}"
|
||||||
|
|
||||||
# build WAR
|
# copy WAR
|
||||||
COPY app /app
|
RUN rm -rf /usr/local/tomcat/webapps/*
|
||||||
COPY config /config
|
COPY ./app/target/contact-center-3.9.0.war.original /usr/local/tomcat/webapps/ROOT.war
|
||||||
WORKDIR /app
|
COPY ./config/tomcat.context.xml /usr/local/tomcat/conf/context.xml
|
||||||
RUN mvn clean package && \
|
|
||||||
rm -rf /opt/apache-tomcat/webapps/ROOT && \
|
|
||||||
cp target/contact-center-*.war.original /opt/apache-tomcat/webapps/ROOT.war && \
|
|
||||||
rm -rf /app && \
|
|
||||||
rm -rf /root/.m2
|
|
||||||
|
|
||||||
EXPOSE 8030-8090 9200 9300
|
EXPOSE 8030-8090 9200 9300
|
||||||
CMD ["/opt/apache-tomcat/bin/catalina.sh", "run"]
|
|
@ -6,7 +6,6 @@
|
|||||||
# constants
|
# constants
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
baseDir=$(cd `dirname "$0"`;pwd)
|
||||||
appHome=$baseDir/..
|
appHome=$baseDir/..
|
||||||
registry=registry.chatopera.com
|
|
||||||
imagename=chatopera/contact-center
|
imagename=chatopera/contact-center
|
||||||
PACKAGE_VERSION=1.0.0
|
PACKAGE_VERSION=1.0.0
|
||||||
# functions
|
# functions
|
||||||
@ -14,6 +13,10 @@ PACKAGE_VERSION=1.0.0
|
|||||||
# main
|
# main
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
||||||
set -x
|
set -x
|
||||||
|
# package
|
||||||
|
$baseDir/package.sh
|
||||||
|
|
||||||
|
# build
|
||||||
cd $appHome
|
cd $appHome
|
||||||
docker build --build-arg VCS_REF=`git rev-parse --short HEAD` --force-rm=true --tag $imagename:$PACKAGE_VERSION .
|
docker build --build-arg VCS_REF=`git rev-parse --short HEAD` --force-rm=true --tag $imagename:$PACKAGE_VERSION .
|
||||||
docker tag $imagename:$PACKAGE_VERSION $imagename:develop
|
docker tag $imagename:$PACKAGE_VERSION $imagename:develop
|
||||||
|
16
contact-center/admin/push.sh
Executable file
16
contact-center/admin/push.sh
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
###########################################
|
||||||
|
#
|
||||||
|
###########################################
|
||||||
|
|
||||||
|
# constants
|
||||||
|
baseDir=$(cd `dirname "$0"`;pwd)
|
||||||
|
imagename=chatopera/contact-center
|
||||||
|
PACKAGE_VERSION=1.0.0
|
||||||
|
|
||||||
|
# functions
|
||||||
|
|
||||||
|
# main
|
||||||
|
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
||||||
|
docker push $imagename:$PACKAGE_VERSION
|
||||||
|
docker push $imagename:develop
|
31
contact-center/config/tomcat.context.xml
Normal file
31
contact-center/config/tomcat.context.xml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
|
this work for additional information regarding copyright ownership.
|
||||||
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
(the "License"); you may not use this file except in compliance with
|
||||||
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<!-- The contents of this file will be loaded for each web application -->
|
||||||
|
<Context>
|
||||||
|
|
||||||
|
<!-- Default set of monitored resources. If one of these changes, the -->
|
||||||
|
<!-- web application will be reloaded. -->
|
||||||
|
<WatchedResource>WEB-INF/web.xml</WatchedResource>
|
||||||
|
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
|
||||||
|
|
||||||
|
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
|
||||||
|
<!--
|
||||||
|
<Manager pathname="" />
|
||||||
|
-->
|
||||||
|
<Resources cachingAllowed="true" cacheMaxSize="100000" />
|
||||||
|
</Context>
|
Loading…
x
Reference in New Issue
Block a user