-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (17 loc) · 776 Bytes
/
Dockerfile
File metadata and controls
24 lines (17 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Build stage
FROM maven:3.9.11-eclipse-temurin-17 AS build
WORKDIR /usr/src/app
COPY . .
RUN mvn package -DskipTests
# Production stage
FROM tomcat:11.0.20-jdk17 AS fnl_base_image
RUN apt-get update && apt-get -y upgrade
# install dependencies and clean up unused files
RUN apt-get update && apt-get install unzip
RUN rm -rf /usr/local/tomcat/webapps.dist
RUN rm -rf /usr/local/tomcat/webapps/ROOT
# Modify the server.xml file to block error reporting
RUN sed -i 's|</Host>| <Valve className="org.apache.catalina.valves.ErrorReportValve"\n showReport="false"\n showServerInfo="false" />\n\n </Host>|' conf/server.xml
# expose ports
EXPOSE 8080
COPY --from=build /usr/src/app/target/Bento-0.0.1.war /usr/local/tomcat/webapps/ROOT.war