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
import { ValidatorConstraint, ValidatorConstraintInterface, ValidationArguments } from 'class-validator'; | |
import { Injectable } from '@nestjs/common'; | |
import { Repository } from 'typeorm'; | |
@ValidatorConstraint({ name: 'exists', async: true }) | |
@Injectable() | |
export class ExistsValidator implements ValidatorConstraintInterface { | |
constructor(private readonly repository: Repository<any>) {} | |
async validate(value: any, args: ValidationArguments) { |
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
FROM php:8-fpm-alpine3.13 as base | |
RUN apk update && apk add g++ make git wget ca-certificates openssl openssh bzip2-dev zlib-dev libpng-dev tzdata fcgi cyrus-sasl-dev | |
# php8-dev | |
RUN update-ca-certificates | |
# install php composer | |
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | |
&& php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \ | |
&& php composer-setup.php --install-dir=/usr/bin --filename=composer \ | |
&& php -r "unlink('composer-setup.php');" |
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
## Java | |
sudo apt-get update | |
sudo apt-get install default-jdk | |
## Scala | |
sudo apt-get remove scala-library scala | |
sudo wget http://scala-lang.org/files/archive/scala-2.12.12.deb | |
sudo dpkg -i scala-2.12.12.deb | |
sudo apt-get update | |
sudo apt-get install scala |