Added Deno functions env
This commit is contained in:
parent
4950666caf
commit
ada7816148
|
@ -29,6 +29,13 @@ return [
|
|||
'image' => 'appwrite/env-python:3.8',
|
||||
'logo' => 'python.png',
|
||||
],
|
||||
'deno-1.2' => [
|
||||
'name' => 'Deno',
|
||||
'version' => '1.2',
|
||||
'base' => 'hayd/deno:alpine-1.2.0',
|
||||
'image' => 'appwrite/env-deno:1.2',
|
||||
'logo' => 'deno.png',
|
||||
],
|
||||
// 'dart-2.8' => [
|
||||
// 'name' => 'Dart',
|
||||
// 'version' => '2.8',
|
||||
|
|
|
@ -7,6 +7,7 @@ use Appwrite\Database\Database;
|
|||
use Appwrite\Database\Adapter\MySQL as MySQLAdapter;
|
||||
use Appwrite\Database\Adapter\Redis as RedisAdapter;
|
||||
use Appwrite\Database\Validator\Authorization;
|
||||
use Utopia\App;
|
||||
use Utopia\CLI\Console;
|
||||
use Utopia\Config\Config;
|
||||
|
||||
|
@ -265,6 +266,7 @@ class FunctionsV1
|
|||
|
||||
$exitCode = Console::execute("docker run \
|
||||
-d \
|
||||
--entrypoint=\"\" \
|
||||
--cpus=4 \
|
||||
--memory=128m \
|
||||
--memory-swap=128m \
|
||||
|
@ -278,7 +280,7 @@ class FunctionsV1
|
|||
{$environment['image']} \
|
||||
sh -c 'mv /tmp/code.tar.gz /usr/local/src/code.tar.gz && tar -zxf /usr/local/src/code.tar.gz --strip 1 && rm /usr/local/src/code.tar.gz && tail -f /dev/null'"
|
||||
, null, $stdout, $stderr, 30);
|
||||
|
||||
|
||||
$executionEnd = \microtime(true);
|
||||
|
||||
if($exitCode !== 0) {
|
||||
|
@ -297,7 +299,7 @@ class FunctionsV1
|
|||
$executionStart = \microtime(true);
|
||||
|
||||
$exitCode = Console::execute("docker exec {$container} {$command}"
|
||||
, null, $stdout, $stderr, $function->getAttribute('timeout', 900)); // TODO add app env for max timeout
|
||||
, null, $stdout, $stderr, $function->getAttribute('timeout', (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900))); // TODO add app env for max timeout
|
||||
|
||||
$executionEnd = \microtime(true);
|
||||
|
||||
|
@ -322,7 +324,7 @@ class FunctionsV1
|
|||
|
||||
Console::success(count($list).' running containers counted');
|
||||
|
||||
$max = 10;
|
||||
$max = (int) App::getEnv('_APP_FUNCTIONS_CONTAINERS');
|
||||
|
||||
if(count($list) > $max) {
|
||||
Console::info('Starting containers cleanup');
|
||||
|
|
11
docker/environments/deno-1.2/Dockerfile
Normal file
11
docker/environments/deno-1.2/Dockerfile
Normal file
|
@ -0,0 +1,11 @@
|
|||
FROM hayd/deno:alpine-1.2.0
|
||||
|
||||
LABEL maintainer="team@appwrite.io"
|
||||
|
||||
RUN apk add tar
|
||||
|
||||
RUN mkdir /usr/local/src
|
||||
|
||||
WORKDIR /usr/local/src/
|
||||
|
||||
ENV DENO_DIR=/usr/local/src/.appwrite
|
7
docker/environments/deno-1.2/build.sh
Normal file
7
docker/environments/deno-1.2/build.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
echo 'Starting Deno 1.2 build...'
|
||||
|
||||
docker build --tag appwrite/env-deno:1.2 .
|
||||
|
||||
echo 'Pushing Deno 1.2 build to registry...'
|
||||
|
||||
docker push appwrite/env-deno:1.2
|
BIN
public/images/environments/deno.png
Normal file
BIN
public/images/environments/deno.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
Loading…
Reference in a new issue