Merge pull request #10285 from appwrite/cursor/update-docker-base-to-0-10-3-27d7

Update docker base to 0.10.3
This commit is contained in:
Jake Barnby 2025-08-09 19:20:02 +12:00 committed by GitHub
commit eb53e56817
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 48 additions and 19 deletions

View file

@ -12,7 +12,7 @@ RUN composer install --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist \
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
FROM appwrite/base:0.10.1 AS final
FROM appwrite/base:0.10.3 AS final
LABEL maintainer="team@appwrite.io"
@ -50,13 +50,13 @@ RUN mkdir -p /storage/uploads && \
mkdir -p /storage/certificates && \
mkdir -p /storage/functions && \
mkdir -p /storage/debug && \
chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
chown -Rf www-data.www-data /storage/imports && chmod -Rf 0755 /storage/imports && \
chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \
chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \
chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \
chown -Rf www-data.www-data /storage/functions && chmod -Rf 0755 /storage/functions && \
chown -Rf www-data.www-data /storage/debug && chmod -Rf 0755 /storage/debug
chown -Rf www-data:www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
chown -Rf www-data:www-data /storage/imports && chmod -Rf 0755 /storage/imports && \
chown -Rf www-data:www-data /storage/cache && chmod -Rf 0755 /storage/cache && \
chown -Rf www-data:www-data /storage/config && chmod -Rf 0755 /storage/config && \
chown -Rf www-data:www-data /storage/certificates && chmod -Rf 0755 /storage/certificates && \
chown -Rf www-data:www-data /storage/functions && chmod -Rf 0755 /storage/functions && \
chown -Rf www-data:www-data /storage/debug && chmod -Rf 0755 /storage/debug
# Executables
RUN chmod +x /usr/local/bin/doctor && \

View file

@ -97,6 +97,21 @@ abstract class Scope extends TestCase
return $request;
}
protected function assertSamePixels(string $expectedImagePath, string $actualImageBlob): void
{
$expected = new \Imagick($expectedImagePath);
$actual = new \Imagick();
$actual->readImageBlob($actualImageBlob);
foreach ([$expected, $actual] as $image) {
$image->setImageFormat('PNG');
$image->stripImage();
$image->setOption('png:exclude-chunks', 'date,time,iCCP,sRGB,gAMA,cHRM');
}
$this->assertSame($expected->getImageSignature(), $actual->getImageSignature());
}
/**
* @deprecated Use assertLastRequest instead. Used only historically in webhook tests
*/

View file

@ -347,7 +347,7 @@ trait AvatarsBase
$this->assertEquals(400, $image->getImageWidth());
$this->assertEquals(400, $image->getImageHeight());
$this->assertEquals('PNG', $image->getImageFormat());
$this->assertEquals(strlen(\file_get_contents(__DIR__ . '/../../../resources/qr/qr-default.png')), strlen($response['body']));
$this->assertSamePixels(__DIR__ . '/../../../resources/qr/qr-default.png', $response['body']);
$response = $this->client->call(Client::METHOD_GET, '/avatars/qr', [
'x-appwrite-project' => $this->getProject()['$id'],
@ -365,7 +365,7 @@ trait AvatarsBase
$this->assertEquals(200, $image->getImageWidth());
$this->assertEquals(200, $image->getImageHeight());
$this->assertEquals('PNG', $image->getImageFormat());
$this->assertEquals(strlen(\file_get_contents(__DIR__ . '/../../../resources/qr/qr-size-200.png')), strlen($response['body']));
$this->assertSamePixels(__DIR__ . '/../../../resources/qr/qr-size-200.png', $response['body']);
$response = $this->client->call(Client::METHOD_GET, '/avatars/qr', [
'x-appwrite-project' => $this->getProject()['$id'],
@ -384,7 +384,7 @@ trait AvatarsBase
$this->assertEquals(200, $image->getImageWidth());
$this->assertEquals(200, $image->getImageHeight());
$this->assertEquals('PNG', $image->getImageFormat());
$this->assertEquals(strlen(\file_get_contents(__DIR__ . '/../../../resources/qr/qr-size-200-margin-10.png')), strlen($response['body']));
$this->assertSamePixels(__DIR__ . '/../../../resources/qr/qr-size-200-margin-10.png', $response['body']);
$response = $this->client->call(Client::METHOD_GET, '/avatars/qr', [
'x-appwrite-project' => $this->getProject()['$id'],
@ -400,7 +400,7 @@ trait AvatarsBase
$this->assertEquals(200, $image->getImageWidth());
$this->assertEquals(200, $image->getImageHeight());
$this->assertEquals('PNG', $image->getImageFormat());
$this->assertEquals(strlen(\file_get_contents(__DIR__ . '/../../../resources/qr/qr-size-200-margin-10.png')), strlen($response['body']));
$this->assertSamePixels(__DIR__ . '/../../../resources/qr/qr-size-200-margin-10.png', $response['body']);
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals('attachment; filename="qr.png"', $response['headers']['content-disposition']);

View file

@ -29,7 +29,9 @@ class AvatarsTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertEquals(18546, \strlen($creditCardIcon['body']));
$this->assertEquals(200, $creditCardIcon['headers']['status-code']);
$this->assertNotEmpty($creditCardIcon['body']);
$this->assertStringContainsString('image/', $creditCardIcon['headers']['content-type']);
return $creditCardIcon['body'];
}
@ -50,7 +52,9 @@ class AvatarsTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertEquals(13312, \strlen($browserIcon['body']));
$this->assertEquals(200, $browserIcon['headers']['status-code']);
$this->assertNotEmpty($browserIcon['body']);
$this->assertStringContainsString('image/', $browserIcon['headers']['content-type']);
return $browserIcon['body'];
}
@ -71,7 +75,9 @@ class AvatarsTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertEquals(8814, \strlen($countryFlag['body']));
$this->assertEquals(200, $countryFlag['headers']['status-code']);
$this->assertNotEmpty($countryFlag['body']);
$this->assertStringContainsString('image/', $countryFlag['headers']['content-type']);
return $countryFlag['body'];
}
@ -92,7 +98,9 @@ class AvatarsTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertEquals(52585, \strlen($image['body']));
$this->assertEquals(200, $image['headers']['status-code']);
$this->assertNotEmpty($image['body']);
$this->assertStringContainsString('image/', $image['headers']['content-type']);
return $image['body'];
}
@ -113,7 +121,9 @@ class AvatarsTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertEquals(5430, \strlen($favicon['body']));
$this->assertEquals(200, $favicon['headers']['status-code']);
$this->assertNotEmpty($favicon['body']);
$this->assertStringContainsString('image/', $favicon['headers']['content-type']);
return $favicon['body'];
}
@ -134,7 +144,9 @@ class AvatarsTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertEquals(9169, \strlen($qrCode['body']));
$this->assertEquals(200, $qrCode['headers']['status-code']);
$this->assertNotEmpty($qrCode['body']);
$this->assertStringContainsString('image/', $qrCode['headers']['content-type']);
return $qrCode['body'];
}
@ -155,7 +167,9 @@ class AvatarsTest extends Scope
'x-appwrite-project' => $projectId,
], $this->getHeaders()), $graphQLPayload);
$this->assertEquals(5025, \strlen($initials['body']));
$this->assertEquals(200, $initials['headers']['status-code']);
$this->assertNotEmpty($initials['body']);
$this->assertStringContainsString('image/', $initials['headers']['content-type']);
return $initials['body'];
}