Skip to content

Add Docker support #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
target
.git
mvnw
mvnw.cmd
.mvn
apiRest-springboot3
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM maven:3.9.6-eclipse-temurin-21 AS build
WORKDIR /app
COPY pom.xml .
COPY src ./src
RUN mvn -B -DskipTests package

FROM eclipse-temurin:21-jre
WORKDIR /app
COPY --from=build /app/target/*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","app.jar"]
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,19 @@ Estas operaciones se encuentran en `ClientControllerImpl`. El procesamiento as\u
- Clases en `src/main/java/com/dhh/apiRestSpringboot3` implementan los controladores, servicios y mapeos de la aplicaci\u00f3n.



## Docker y despliegue en Render

Para construir la imagen de Docker localmente:

```bash
docker build -t api-rest-springboot3 .
```

Luego se puede ejecutar con:

```bash
docker run -p 8080:8080 api-rest-springboot3
```

En Render, crea un nuevo servicio de tipo **Docker** y proporciona este repositorio. Render ejecutará el `Dockerfile` para construir y desplegar la aplicación automáticamente.