File size: 611 Bytes
ba87331
 
 
 
 
 
 
 
 
 
 
 
dcb5aa6
ba87331
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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"]