USER root
RUN echo -e "$PASSWORD\n$PASSWORD" | passwd $USER_NAME
USER $USER_NAME
WORKDIR /home/$USER_NAME
RUN echo $(whoami)| tee /home/$USER_NAME/test2.txt
ADD test1.txt /
depends_on:
elasticsearch:
condition: service_healthy
и healthcheck:
test:
[
"CMD-SHELL",
"curl http://localhost:9200 | grep -q 'You Know, for Search'",
]
interval: 10s
timeout: 10s
retries: 60
@GetMapping(value = "/redirect1")
public ResponseEntity<String> redirect1(@RequestParam String param) {
return ResponseEntity.status(HttpStatus.FOUND)
.header("Location", "confirm1?param=" + param).body(null);
}
@GetMapping(value = "/redirect2")
public ResponseEntity<String> redirect2(@RequestParam String param) {
return ResponseEntity.status(HttpStatus.FOUND)
.header("Location", "confirm2/" + param).body(null);
}
@GetMapping(value = "/confirm1", produces = {
MediaType.APPLICATION_JSON_VALUE })
@ResponseBody
public Map<String, String> confirm1(@RequestParam String param) {
data.put("param", param);
return data;
}
@RequestMapping(method = RequestMethod.GET, value = "/confirm2/{param}", produces = {
MediaType.APPLICATION_JSON_VALUE })
@ResponseBody
public Map<String, String> confirm2(@PathVariable("param") String param) {
data.put("param", param);
return data;
}