-
docker run -d --restart=always -p 127.0.0.1:23750:2375 -v /var/run/docker.sock:/var/run/docker.sock alpine/socat tcp-listen:2375,fork,reuseaddr unix-connect:/var/run/docker.sock
-
netsh interface portproxy add v4tov4 listenport=23750 listenaddress=<PUBLIC IP> connectaddress=127.0.0.1 connectport=23750
. PUBLIC-IP= local network IP -
firewall inbound rule to expose
23750
port
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const config = require("./config/config") | |
const express = require("express") | |
const bodyParser = require("body-parser") | |
const morgan = require('morgan') | |
const cors = require("cors") | |
const router = require("./router/router") | |
const helmet = require('helmet') | |
const app = express() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uninstall old versions | |
sudo apt-get remove docker docker-engine docker.io containerd runc | |
# SETUP REPO | |
# Update the apt package index: | |
sudo apt-get update | |
# Install packages to allow apt to use a repository over HTTPS: | |
sudo apt-get install \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private <E> int findtheLastNoFromtheList( List<E> list, String getFieldName ) | |
{ | |
if ( list.isEmpty() ) | |
{ | |
return 0; | |
} | |
int maxCount = 0; | |
try | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
@ResponseStatus(HttpStatus.BAD_REQUEST) | |
protected ResponseEntity<Object> handleMethodArgumentNotValid( MethodArgumentNotValidException e, | |
HttpHeaders headers, HttpStatus status, WebRequest request ) | |
{ | |
ApiError apiError = createError( MESSAGE_FOR_INVALID_BODY_ERROR, HttpStatus.BAD_REQUEST, e ); | |
return new ResponseEntity<>( apiError, apiError.getStatus() ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ExceptionHandler(ConstraintViolationException.class) | |
@ResponseStatus(value = HttpStatus.BAD_REQUEST) | |
public ResponseEntity<Object> handleConstraintViolationException( ConstraintViolationException e ) | |
{ | |
ApiError apiError = createError( MESSAGE_FOR_INVALID_PARAMETERS_ERROR, HttpStatus.BAD_REQUEST, e ); | |
return new ResponseEntity<>( apiError, apiError.getStatus() ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ResponseStatus(HttpStatus.NOT_FOUND) | |
public class ResourceNotFoundException extends RuntimeException | |
{ | |
public ResourceNotFoundException( String exception ) | |
{ | |
super( exception ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Data | |
class ApiError | |
{ | |
private HttpStatus status; | |
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DATE_FORMAT) | |
private LocalDateTime timestamp; | |
private String message; | |
private String debugMessage; |
NewerOlder