diff --git a/Dockerfile b/Dockerfile index b53cb479dfb5e71ea1ad02ca92320de456aed691..e72d32499bb1e9ff23ecffafac5ba9ffbc665fb6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,7 @@ RUN coffee --version RUN sass --version COPY wait-for-it.sh / +COPY wad.sh / + +RUN chmod 777 /wad.sh RUN chmod 777 /wait-for-it.sh \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 275f121147ad8994cc3557b7ec37fa3c3b551b45..a6108da5bd6b9a916cb27407dad845d929cc2c85 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: container_name: 'corporate_app2' ports: - 8080:8080 - - 8000:8000 + - 5005:5005 depends_on: - db working_dir: '/app' @@ -18,6 +18,14 @@ services: command: > bash -c "/./wait-for-it.sh corporate_db2:5432 -- \ mvn clean spring-boot:run" + static_wad: + build: . + restart: always + volumes: + - .:/app + container_name: 'corporate_static_watcher' + command: /bin/bash -c '/wad.sh' + db: image: 'postgres:10-alpine' diff --git a/pom.xml b/pom.xml index dd47dd32a95d820f98b2fd8f89b5c96a614cea9d..faafc86e7df031e001a3041b656d4b5ddbc24bca 100644 --- a/pom.xml +++ b/pom.xml @@ -80,6 +80,9 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <excludeDevtools>false</excludeDevtools> + </configuration> </plugin> <plugin> <artifactId>exec-maven-plugin</artifactId> diff --git a/src/main/kotlin/com/s3ai/corporate_app2/controllers/UserController.kt b/src/main/kotlin/com/s3ai/corporate_app2/controllers/UserController.kt new file mode 100644 index 0000000000000000000000000000000000000000..260fbaa6016c1ac348eb27f6f50f36d25bc2a11f --- /dev/null +++ b/src/main/kotlin/com/s3ai/corporate_app2/controllers/UserController.kt @@ -0,0 +1,20 @@ +package com.s3ai.corporate_app2.controllers + +import org.springframework.stereotype.Controller +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping + +@Controller +@RequestMapping("/users") +class UserController { + + @GetMapping("/list") + fun getUsersList(): String? { + return "index" + } + + @GetMapping("/edit") + fun getUsersEditPage(): String? { + return "index" + } +} \ No newline at end of file diff --git a/wad.sh b/wad.sh index 07ca4a450e18d18606cd93e6c5f03dcbceda3d14..22acb3b3a7eb92b6f5298899f39debe9bd0e56a9 100644 --- a/wad.sh +++ b/wad.sh @@ -1,5 +1,5 @@ #!/bin/bash -chmod 777 ./builder.sh +chmod 777 /app/compile_static.sh while true; do - find . \( -name .idea -o -name .m2 -o -name target \) -prune -o -name "*.kt" -o -name "*.scss" -o -name "*.coffee" -o -name "*.html" | entr ./builder.sh + find . \( -name .idea -o -name .m2 -o -name target \) -prune -o -name "*.scss" -o -name "*.coffee" | entr /app/compile_static.sh done \ No newline at end of file