Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeMBourgeois authored May 3, 2024
1 parent 8011156 commit 9497d7b
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
FROM eclipse-temurin:17-jre-alpine
WORKDIR /application
# Utiliser une image de base qui inclut Tomcat 10 et Java 17.
FROM tomcat:10-jdk17-temurin

RUN addgroup -g 10000 javagroup
RUN adduser -D -s / -u 10000 javauser -G javagroup
RUN chown -R 10000:10000 /application
# Définir le répertoire de travail pour Tomcat.
WORKDIR /usr/local/tomcat

USER 10000
COPY target/*.war metadata-api.war
ENTRYPOINT ["java", "-war", "/application/metadata-api.war"]
# Ajouter votre fichier .war dans le dossier webapps de Tomcat.
COPY target/*.war /usr/local/tomcat/webapps/metadata-api.war

# Exposer le port sur lequel Tomcat écoute par défaut.
EXPOSE 8080

# Configurer l'utilisateur pour des raisons de sécurité (si nécessaire).
RUN addgroup --system javagroup && \
adduser --system --shell /bin/false --uid 10000 --ingroup javagroup --no-create-home javauser && \
chown -R javauser:javagroup /usr/local/tomcat && \
chmod -R 755 /usr/local/tomcat/webapps

USER javauser

# Lancer Tomcat.
CMD ["catalina.sh", "run"]

0 comments on commit 9497d7b

Please sign in to comment.