fix: update Dockerfile to run tests during build and adjust TodoController request mapping
This commit is contained in:
@@ -3,7 +3,7 @@ FROM maven:3.9.12-eclipse-temurin-25 AS build
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY pom.xml .
|
COPY pom.xml .
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
RUN mvn clean package -DskipTests
|
RUN mvn clean package
|
||||||
|
|
||||||
# Run stage
|
# Run stage
|
||||||
FROM eclipse-temurin:25-jre
|
FROM eclipse-temurin:25-jre
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ import java.util.List;
|
|||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/todos")
|
@RequestMapping("/todos")
|
||||||
@CrossOrigin(origins = "*")
|
|
||||||
public class TodoController {
|
public class TodoController {
|
||||||
|
|
||||||
private final TodoService todoService;
|
private final TodoService todoService;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
server.servlet.context-path=/api
|
||||||
spring.application.name=backend
|
spring.application.name=backend
|
||||||
spring.datasource.url=jdbc:postgresql://localhost:5432/tododb
|
spring.datasource.url=jdbc:postgresql://localhost:5432/tododb
|
||||||
spring.datasource.username=postgres
|
spring.datasource.username=postgres
|
||||||
|
|||||||
Reference in New Issue
Block a user