This file contains hidden or 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
@Pipe({ | |
name: 'duration', | |
pure: true | |
}) | |
export class DurationPipe implements PipeTransform { | |
transform(value: any): any { | |
const { min, sec } = parseDuration(value); | |
return `${min}m${padTime(sec)}s`; | |
} | |
} |
This file contains hidden or 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
@Component({ | |
selector: 'app-dashboard', | |
templateUrl: './dashboard.component.html', | |
styleUrls: ['./dashboard.component.scss'], | |
changeDetection: ChangeDetectionStrategy.OnPush | |
}) |
This file contains hidden or 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
- app | |
-- core | |
-- features | |
-- shared | |
-- styles | |
-- assets |
This file contains hidden or 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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
creationTimestamp: null | |
labels: | |
run: MyPod | |
name: MyPod | |
namespace: fire | |
spec: | |
containers: |
This file contains hidden or 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
apiVersion: v1 | |
data: | |
database_host: 192.168.16.1 | |
kind: ConfigMap | |
metadata: | |
creationTimestamp: null | |
name: MyConfigMap | |
namespace: fire |
This file contains hidden or 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
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
CreateHostBuilder(args).Build().Run(); | |
} | |
public static IHostBuilder CreateHostBuilder(string[] args) => | |
Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder => | |
{ |
This file contains hidden or 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
[ApiController] | |
[Route("[controller]")] | |
public class HealthCheckController : ControllerBase | |
{ | |
private readonly ILogger<HealthCheckController> _logger; | |
public HealthCheckController(ILogger<HealthCheckController> logger) | |
{ | |
_logger = logger; | |
} |
This file contains hidden or 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
[ApiController] | |
[Route("[controller]")] | |
public class HealthCheckController : ControllerBase | |
{ | |
private readonly ILogger<HealthCheckController> _logger; | |
public HealthCheckController(ILogger<HealthCheckController> logger) | |
{ | |
_logger = logger; | |
} |
This file contains hidden or 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
# We use the alpine as base image | |
FROM mcr.microsoft.com/dotnet/aspnet:5.0-alpine-amd64 | |
# Perform the health check call via curl | |
HEALTHCHECK --interval=5s --timeout=3s CMD curl --fail http://localhost/healthcheck || exit 1 | |
RUN apk --update --no-cache add curl | |
# Create a group and usermcr.microsoft.com/dotnet/runtime | |
RUN addgroup --gid 1000 -S app && adduser --uid 1000 -S app -G app |
This file contains hidden or 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
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
AppDomain.CurrentDomain.ProcessExit += (_, _) => | |
{ | |
Console.WriteLine("Received SIGTERM"); | |
}; | |
Console.CancelKeyPress += (_, _) => |