I implemented, in a spring boot application, the locale function.
On my local computer, with the dev and prod profile, when I add? Lang = en or? Lang = fr my view is automatically translated.
I just noticed that when I dockerize, with the prod profile, my project, on my production server, the? lang = en function no longer works.
I do not understand why.
Here is my DockerFile
FROM openjdk:11.0.11-oraclelinux7
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Dspring.profiles.active=prod","-jar","/app.jar"]
To remove the version problem, I deleted the Dockerfile and I built my image with
./mvnw clean spring-boot: build-image
but the problem is the same. If from my server, I curl localhost:port?Lang=en I have no reaction.
Conclusion on my personal computer,? Lang = fr works with the prod and dev profile, but it does not work on the production server, which is contained in a docker ....
thank you so much
Ok!:
According to the following link After docker-compose build language switching does not work the problem comes from the lack of locale in the dockerfile. I have to test if by directly adding the locales to my server, if I can keep the openjdk image. To solve my problem I used the ubuntu image and I added the locales