Gacirane Patrick
deploy
dcb5aa6
Raw
History Blame Contribute Delete
611 Bytes
FROM tomcat:9.0-jdk11
# Install tools
RUN apt-get update && \
apt-get install -y git maven && \
rm -rf /var/lib/apt/lists/*
WORKDIR /build
# Clone at build time using ENV (set in HF Space secrets)
ARG GITHUB_PAT
RUN git clone --depth 1 \
https://${GITHUB_PAT}@github.com/pgacirane/Smart_Grad_UI.git app
# Build WAR
RUN cd app && mvn clean package -DskipTests -q
# Deploy to Tomcat ROOT
RUN cp app/target/*.war /usr/local/tomcat/webapps/ROOT.war
# Change Tomcat port to 7860
RUN sed -i 's/port="8080"/port="7860"/' \
/usr/local/tomcat/conf/server.xml
EXPOSE 7860
CMD ["catalina.sh", "run"]