mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-14 03:33:43 +08:00
- mateclaw-server/settings.xml: Maven mirror routes requests through Aliyun so dependency:go-offline no longer hangs in restricted networks - Dockerfile: COPY settings.xml into /root/.m2/ before any mvn command - docker-compose.yml: fix port mapping 18080->18088 (app listens on 18088) - docker-compose.yml: remove legacy schema.sql/data.sql MySQL mounts; Flyway manages schema creation from V1 baseline on startup
27 lines
820 B
Docker
27 lines
820 B
Docker
# Multi-stage build
|
|
FROM maven:3.9-eclipse-temurin-21 AS builder
|
|
|
|
# Inject mirror settings to avoid Maven Central timeouts in restricted networks
|
|
COPY mateclaw-server/settings.xml /root/.m2/settings.xml
|
|
|
|
# Build and install plugin-api into the local Maven cache first
|
|
WORKDIR /plugin-api
|
|
COPY mateclaw-plugin-api/pom.xml ./pom.xml
|
|
COPY mateclaw-plugin-api/src ./src
|
|
RUN mvn install -DskipTests -q
|
|
|
|
# Pre-fetch mateclaw-server dependencies (uses mirror, so this won't hang)
|
|
WORKDIR /build
|
|
COPY mateclaw-server/pom.xml .
|
|
RUN mvn dependency:go-offline -q
|
|
|
|
# Build the final JAR
|
|
COPY mateclaw-server/src ./src
|
|
RUN mvn package -DskipTests -q
|
|
|
|
FROM eclipse-temurin:21-jre-alpine
|
|
WORKDIR /app
|
|
COPY --from=builder /build/target/*.jar app.jar
|
|
EXPOSE 18088
|
|
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=mysql", "app.jar"]
|