Skip to content

Commit

Permalink
update resources
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed May 2, 2024
1 parent 0161509 commit 45e9336
Show file tree
Hide file tree
Showing 2,333 changed files with 58 additions and 685,184 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -427,7 +427,7 @@ bootJar {
dependsOn publicFrontendIndexTransform//, adminFrontendIndexTransform
archiveClassifier.set('boot')
from(tasks.named("frontendBuild")) {
into 'resources'
into 'BOOT-INF/classes/resources/'
}
from(tasks.named("publicFrontendIndexTransform")) {
rename 'alfio-public-frontend-index.html', 'BOOT-INF/classes/alfio-public-frontend-index.html'
Expand Down
20 changes: 10 additions & 10 deletions src/main/dist/Dockerfile
Expand Up @@ -5,17 +5,17 @@
# - https://august.nagro.us/small-java.html
#

FROM azul/zulu-openjdk-alpine:17 as zulu
FROM azul/zulu-openjdk-alpine:17 AS zulu
COPY alfio-boot.jar .
RUN $JAVA_HOME/bin/jlink --compress=1 --strip-java-debug-attributes --no-header-files --no-man-pages \
--module-path $JAVA_HOME/jmods \
RUN "$JAVA_HOME/bin/jlink" --compress=2 --strip-java-debug-attributes --no-header-files --no-man-pages \
--module-path "$JAVA_HOME/jmods" \
# see https://docs.oracle.com/en/java/javase/11/security/oracle-providers.html#GUID-9224B90B-7B2F-41F9-BB96-C0A1B6A0FEAA
--add-modules java.desktop,java.logging,java.sql,java.management,java.naming,jdk.unsupported,jdk.crypto.ec,java.net.http,jdk.localedata,java.instrument \
--include-locales en,it,es,nl,fr,de,ro,pt,tr,pl,da,bg,sv,cs \
--output /jlinked

RUN /jlinked/bin/java -Xshare:dump -XX:+UseSerialGC -version
RUN $JAVA_HOME/bin/java -Djarmode=tools -jar alfio-boot.jar extract --destination /cds && \
RUN "$JAVA_HOME/bin/java" -Djarmode=tools -jar alfio-boot.jar extract --destination /cds && \
(cd /cds && java -XX:ArchiveClassesAtExit=alfio-cds.jsa -Dspring.profiles.active=app-cds -Dspring.context.exit=onRefresh -jar alfio-boot.jar)


Expand All @@ -25,19 +25,19 @@ LABEL org.opencontainers.image.source=https://github.com/alfio-event/alf.io
COPY --from=zulu /jlinked /opt/jdk/

ENV LANG en_US.UTF-8
RUN addgroup -S alfio
RUN adduser -h /home/alfio -u 1001 -G alfio -S alfio
RUN apk update
RUN apk add --update ttf-dejavu && rm -rf /var/cache/apk/*
RUN addgroup -S alfio \
&& adduser -h /home/alfio -u 1001 -G alfio -S alfio \
&& apk update \
&& apk add --update ttf-dejavu \
&& rm -rf /var/cache/apk/*

USER 1001

# Define working directory.
RUN mkdir /home/alfio/app
WORKDIR /home/alfio/app

COPY --chown=alfio --from=zulu /cds/alfio-cds.jsa .
COPY --chown=alfio alfio-boot.jar .
COPY --chown=alfio --from=zulu /cds/* /home/alfio/app/

ENV ALFIO_JAVA_OPTS=""
ENV ALFIO_PERFORMANCE_OPTS="-Dspring.jmx.enabled=false -Dlog4j2.disableJmx=true"
Expand Down
17 changes: 8 additions & 9 deletions src/main/java/alfio/config/MvcConfiguration.java
Expand Up @@ -31,7 +31,6 @@
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.session.FindByIndexNameSessionRepository;
import org.springframework.session.config.annotation.web.http.SpringHttpSessionConfiguration;
import org.springframework.session.jdbc.config.annotation.web.http.EnableJdbcHttpSession;
import org.springframework.session.security.SpringSessionBackedSessionRegistry;
import org.springframework.session.web.http.CookieHttpSessionIdResolver;
Expand Down Expand Up @@ -77,28 +76,28 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {

var defaultCacheControl = CacheControl.maxAge(Duration.ofDays(isLive ? 10 : 0)).mustRevalidate();

registry.addResourceHandler(alfioVersion + "/resources/**")
.addResourceLocations("/resources/")
registry.addResourceHandler("/resources/font/*", alfioVersion + "/resources/font/*")
.addResourceLocations("classpath:/font/")
.setCachePeriod(cacheMinutes * 60)
.setCacheControl(defaultCacheControl);

registry.addResourceHandler("/resources/font/*")
.addResourceLocations("/resources/font/")
registry.addResourceHandler( "/resources/images/*", alfioVersion +"/resources/images/*")
.addResourceLocations("classpath:/images/")
.setCachePeriod(cacheMinutes * 60)
.setCacheControl(defaultCacheControl);

registry.addResourceHandler("/resources/images/**")
.addResourceLocations("/resources/images/")
registry.addResourceHandler(alfioVersion + "/resources/**")
.addResourceLocations("classpath:/alfio-admin-v1/")
.setCachePeriod(cacheMinutes * 60)
.setCacheControl(defaultCacheControl);

registry.addResourceHandler("/frontend-public/**")
.addResourceLocations("/resources/alfio-public-frontend/")
.addResourceLocations("classpath:/resources/alfio-public-frontend/")
.setCachePeriod(cacheMinutes * 60)
.setCacheControl(CacheControl.maxAge(Duration.ofDays(60)));

registry.addResourceHandler("/frontend-admin/**")
.addResourceLocations("/resources/alfio-admin-frontend/")
.addResourceLocations("classpath:/resources/alfio-admin-frontend/")
.setCachePeriod(cacheMinutes * 60)
.setCacheControl(CacheControl.maxAge(Duration.ofDays(60)));

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/.gitignore
@@ -0,0 +1,2 @@
!public
!resources
File renamed without changes.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes

0 comments on commit 45e9336

Please sign in to comment.