fix(docker): honor SPRING_PROFILES_ACTIVE instead of pinning the mysql profile

This commit is contained in:
matevip 2026-06-14 16:47:16 +08:00
parent 5685b09fd2
commit 1887dd3f70

View File

@ -109,7 +109,14 @@ ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \
LC_ALL=C.UTF-8 \
JAVA_TOOL_OPTIONS="-Duser.timezone=Asia/Shanghai -Dsun.jnu.encoding=UTF-8"
# Default DB profile, overridable by the SPRING_PROFILES_ACTIVE env var
# (compose sets it explicitly: mysql / postgres / kingbase). It must be an ENV,
# not a -D system property on the ENTRYPOINT: a hardcoded
# -Dspring.profiles.active outranks the SPRING_PROFILES_ACTIVE env var and would
# silently pin the profile regardless of what compose passes.
ENV SPRING_PROFILES_ACTIVE=mysql
COPY --from=builder /build/mateclaw-server/target/*.jar app.jar
EXPOSE 18088
EXPOSE 1455
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=mysql", "app.jar"]
ENTRYPOINT ["java", "-jar", "app.jar"]