tomcat的dockerfile bulid项目
Tags:
Dockerfile
#基础镜像选择alpine 小巧安全流行方便
FROM exxk/tomcat:8-alpine-cst-font
#复制固定路径下打包好的jar包(target/*.jar)并重命名到容器跟目录(/app.jar),或ADD
COPY target/app.war /usr/local/tomcat/webapps/
#修改tomcat默认端口
#RUN sed -i 's|port="8080"|port="80"|g' /usr/local/tomcat/conf/server.xml
#健康检查 -s 静默模式,不下载文件
#HEALTHCHECK CMD wget -s http://127.0.0.1:14030/actuator/health || exit 1
#启动命令
#添加其他字体,放入这个目录,也可以直接在基础镜像里面添加
COPY chinese /usr/share/fonts/chinese
CMD ["catalina.sh", "run"]
Dockercompose.yml
version: '3.2'
services:
app:
restart: always
#新编译的镜像名
image: extentTomcat:latest
# volumes:
# - /logs/ygl-app:/app/log
environment:
# 远程debug
CATALINA_OPTS: "-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,suspend=n,server=y"
# MYSQL_URL: mysql
ports:
- 14083:8080
- 14082:5005
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints: [node.hostname == ?]
Content type
Image
Digest
Size
87.2 MB
Last updated
over 5 years ago
docker pull exxk/tomcat:8-alpine-cst-font-web