Skip to content

Commit 0096a86

Browse files
authored
Replace Tomcat with Spring Boot (#4963)
1 parent 728c6f1 commit 0096a86

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.devcontainer/images/uaa/Dockerfile

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,29 @@ USER root
1616

1717
# Adapt issuer URI
1818
# Copy to uaa URL
19-
RUN yq e '.issuer.uri = "http://localhost:8080"' -i /uaa.yml \
19+
# Add password.write authority to admin client (needed for password management tests)
20+
RUN yq e '.oauth.clients.admin.authorities += ",password.write"' -i /uaa.yml \
21+
&& yq e '.issuer.uri = "http://localhost:8080"' -i /uaa.yml \
2022
&& yq e '.uaa.url = .issuer.uri' -i /uaa.yml
2123

22-
# Runtime image
23-
FROM tomcat:10-jdk21
24+
# Runtime image - lightweight JRE instead of Tomcat
25+
FROM sapmachine:21-jre-headless-ubuntu-jammy
2426

2527
# Copy config file from yq image
2628
COPY --from=yq /uaa.yml /uaa.yml
2729

28-
# Remove pre-installed apps
29-
RUN rm -rf /usr/local/tomcat/webapps/*
30-
31-
# Copy CF users
30+
# Copy CF users config
3231
RUN mkdir -p /usr/local/cf_config
3332
COPY uaa.yml /usr/local/cf_config/uaa.yml
3433

35-
36-
# Install war from build image
37-
COPY --from=builder /uaa/uaa/build/libs/cloudfoundry-identity-uaa-*.war /usr/local/tomcat/webapps/ROOT.war
34+
# Install JAR from build image (Spring Boot executable JAR)
35+
COPY --from=builder /uaa/uaa/build/libs/cloudfoundry-identity-uaa-*.war /app/uaa.jar
3836
COPY --from=builder /uaa/k8s/templates/log4j2.properties /log4j2.properties
3937

4038
ENV JAVA_OPTS="-DLOGIN_CONFIG_URL=file:///uaa.yml -Dlogging.config=/log4j2.properties -DCLOUDFOUNDRY_CONFIG_PATH=/usr/local/cf_config"
41-
ENV spring_profiles=default
39+
ENV SPRING_PROFILES_ACTIVE=default
40+
41+
EXPOSE 8080
4242

43-
EXPOSE 8080
43+
# Run as Spring Boot application
44+
CMD ["sh", "-c", "java $JAVA_OPTS -jar /app/uaa.jar"]

0 commit comments

Comments
 (0)