mateclaw/mateclaw-server/Dockerfile
matevip c152a8bae9 fix(docker): add Aliyun Maven mirror, fix port mapping, remove legacy schema init
- 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
2026-04-24 10:26:19 +08:00

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"]