Skip to content

Instantly share code, notes, and snippets.

@andresavilesdev
Created April 1, 2025 01:55
Show Gist options
  • Select an option

  • Save andresavilesdev/9e4c678562a1b415bf4971820d9e85fc to your computer and use it in GitHub Desktop.

Select an option

Save andresavilesdev/9e4c678562a1b415bf4971820d9e85fc to your computer and use it in GitHub Desktop.
# Imagen modelo
FROM <image> -> eclipse-temurin:21.0.3_9-jdk
# Definir directorio raiz de nuestro contenedor
WORKDIR /root
# Copiar y pegar archivos dentro del contenedor
COPY ./pom.xml /root
COPY ./.mvn /root/.mvn
COPY ./mvnw /root
# Descargar las dependencias
RUN ./mvnw dependency:go-offline
# Copiar codigo fuente dentro del contenedor
COPY ./src /root/src
# Construir nuestra aplicacion
RUN ./mvnw clean install -DskipTests
# Levantar nuestra app cuando el contenedor inicie
ENTRYPOINT ["java","-jar","/root/target/<.jar>"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment