Spaces:
Running
Running
Gacirane Patrick commited on
Commit ·
ca246ff
1
Parent(s): bd0267c
fix runtime clone
Browse files- Dockerfile +9 -24
- README.md +5 -5
- start.sh +1 -1
Dockerfile
CHANGED
|
@@ -1,34 +1,19 @@
|
|
| 1 |
FROM tomcat:9.0-jdk11
|
| 2 |
|
| 3 |
-
# Install
|
| 4 |
RUN apt-get update && \
|
| 5 |
apt-get install -y git maven && \
|
| 6 |
rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
-
# Clone private Java Maven repo
|
| 15 |
-
RUN --mount=type=secret,id=GITHUB_PAT \
|
| 16 |
-
GITHUB_PAT=$(cat /run/secrets/GITHUB_PAT) && \
|
| 17 |
-
git clone --depth 1 \
|
| 18 |
-
https://${GITHUB_PAT}@github.com/pgacirane/BOTSUIT.git \
|
| 19 |
-
app
|
| 20 |
-
|
| 21 |
-
# Build the WAR file
|
| 22 |
-
RUN cd app && mvn clean package -DskipTests -q
|
| 23 |
-
|
| 24 |
-
# Deploy WAR to Tomcat
|
| 25 |
-
RUN cp app/target/*.war /usr/local/tomcat/webapps/ROOT.war
|
| 26 |
-
|
| 27 |
-
# HuggingFace requires port 7860
|
| 28 |
-
RUN sed -i 's/port="8080"/port="7860"/' /usr/local/tomcat/conf/server.xml
|
| 29 |
-
|
| 30 |
-
# Expose port
|
| 31 |
EXPOSE 7860
|
| 32 |
|
| 33 |
-
#
|
| 34 |
-
CMD ["
|
|
|
|
| 1 |
FROM tomcat:9.0-jdk11
|
| 2 |
|
| 3 |
+
# Install tools
|
| 4 |
RUN apt-get update && \
|
| 5 |
apt-get install -y git maven && \
|
| 6 |
rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
+
# Copy startup script
|
| 9 |
+
COPY start.sh /start.sh
|
| 10 |
+
RUN chmod +x /start.sh
|
| 11 |
|
| 12 |
+
# Change Tomcat port to 7860
|
| 13 |
+
RUN sed -i 's/port="8080"/port="7860"/' \
|
| 14 |
+
/usr/local/tomcat/conf/server.xml
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
EXPOSE 7860
|
| 17 |
|
| 18 |
+
# Runtime: clones private repo then starts Tomcat
|
| 19 |
+
CMD ["/start.sh"]
|
README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
colorTo: green
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
license: apache-2.0
|
| 9 |
-
short_description: A
|
| 10 |
---
|
| 11 |
|
| 12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: BOTSUIT
|
| 3 |
+
emoji: 🤖
|
| 4 |
+
colorFrom: gray
|
| 5 |
colorTo: green
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
license: apache-2.0
|
| 9 |
+
short_description: A UI to access all AI bots built by GACIRANE Patrick
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
start.sh
CHANGED
|
@@ -12,4 +12,4 @@ echo ">>> Deploying WAR to Tomcat..."
|
|
| 12 |
cp /build/app/target/*.war /usr/local/tomcat/webapps/ROOT.war
|
| 13 |
|
| 14 |
echo ">>> Starting Tomcat on port 7860..."
|
| 15 |
-
catalina.sh run
|
|
|
|
| 12 |
cp /build/app/target/*.war /usr/local/tomcat/webapps/ROOT.war
|
| 13 |
|
| 14 |
echo ">>> Starting Tomcat on port 7860..."
|
| 15 |
+
catalina.sh run
|