Skip to content

Commit

Permalink
Refactor docker-compose files to remove version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed May 8, 2024
1 parent 3eb4aed commit fb80318
Show file tree
Hide file tree
Showing 18 changed files with 5 additions and 25 deletions.
1 change: 0 additions & 1 deletion app/Actions/Database/StartClickhouse.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function handle(StandaloneClickhouse $database)
$environment_variables = $this->generate_environment_variables();

$docker_compose = [
'version' => '3.8',
'services' => [
$container_name => [
'image' => $this->database->image,
Expand Down
1 change: 0 additions & 1 deletion app/Actions/Database/StartDatabaseProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public function handle(StandaloneRedis|StandalonePostgresql|StandaloneMongodb|St
COPY nginx.conf /etc/nginx/nginx.conf
EOF;
$docker_compose = [
'version' => '3.8',
'services' => [
$proxyContainerName => [
'build' => [
Expand Down
1 change: 0 additions & 1 deletion app/Actions/Database/StartDragonfly.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public function handle(StandaloneDragonfly $database)
$environment_variables = $this->generate_environment_variables();

$docker_compose = [
'version' => '3.8',
'services' => [
$container_name => [
'image' => $this->database->image,
Expand Down
1 change: 0 additions & 1 deletion app/Actions/Database/StartKeydb.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public function handle(StandaloneKeydb $database)
$this->add_custom_keydb();

$docker_compose = [
'version' => '3.8',
'services' => [
$container_name => [
'image' => $this->database->image,
Expand Down
1 change: 0 additions & 1 deletion app/Actions/Database/StartMariadb.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public function handle(StandaloneMariadb $database)
$environment_variables = $this->generate_environment_variables();
$this->add_custom_mysql();
$docker_compose = [
'version' => '3.8',
'services' => [
$container_name => [
'image' => $this->database->image,
Expand Down
1 change: 0 additions & 1 deletion app/Actions/Database/StartMongodb.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public function handle(StandaloneMongodb $database)
$this->add_custom_mongo_conf();

$docker_compose = [
'version' => '3.8',
'services' => [
$container_name => [
'image' => $this->database->image,
Expand Down
1 change: 0 additions & 1 deletion app/Actions/Database/StartMysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public function handle(StandaloneMysql $database)
$environment_variables = $this->generate_environment_variables();
$this->add_custom_mysql();
$docker_compose = [
'version' => '3.8',
'services' => [
$container_name => [
'image' => $this->database->image,
Expand Down
1 change: 0 additions & 1 deletion app/Actions/Database/StartPostgresql.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public function handle(StandalonePostgresql $database)
$this->add_custom_conf();

$docker_compose = [
'version' => '3.8',
'services' => [
$container_name => [
'image' => $this->database->image,
Expand Down
1 change: 0 additions & 1 deletion app/Actions/Database/StartRedis.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public function handle(StandaloneRedis $database)
$this->add_custom_redis();

$docker_compose = [
'version' => '3.8',
'services' => [
$container_name => [
'image' => $this->database->image,
Expand Down
1 change: 0 additions & 1 deletion app/Jobs/ApplicationDeploymentJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,6 @@ private function generate_compose_file()
$this->application->parseHealthcheckFromDockerfile($dockerfile);
}
$docker_compose = [
'version' => '3.8',
'services' => [
$this->container_name => [
'image' => $this->production_image_name,
Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Project/Database/Heading.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function activityFinished()

public function check_status($showNotification = false)
{
GetContainersStatus::run($this->application->destination->server);
GetContainersStatus::run($this->database->destination->server);
// dispatch_sync(new ContainerStatusJob($this->database->destination->server));
$this->database->refresh();
if ($showNotification) $this->dispatch('success', 'Database status updated.');
Expand Down
4 changes: 0 additions & 4 deletions bootstrap/helpers/shared.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
$allServices = getServiceTemplates();
$topLevelVolumes = collect(data_get($yaml, 'volumes', []));
$topLevelNetworks = collect(data_get($yaml, 'networks', []));
$dockerComposeVersion = data_get($yaml, 'version') ?? '3.8';
$services = data_get($yaml, 'services');

$generatedServiceFQDNS = collect([]);
Expand Down Expand Up @@ -1192,7 +1191,6 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
return $service;
});
$finalServices = [
'version' => $dockerComposeVersion,
'services' => $services->toArray(),
'volumes' => $topLevelVolumes->toArray(),
'networks' => $topLevelNetworks->toArray(),
Expand Down Expand Up @@ -1230,7 +1228,6 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
$topLevelVolumes = collect([]);
}
$topLevelNetworks = collect(data_get($yaml, 'networks', []));
$dockerComposeVersion = data_get($yaml, 'version') ?? '3.8';
$services = data_get($yaml, 'services');

$generatedServiceFQDNS = collect([]);
Expand Down Expand Up @@ -1661,7 +1658,6 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
});
}
$finalServices = [
'version' => $dockerComposeVersion,
'services' => $services->toArray(),
'volumes' => $topLevelVolumes->toArray(),
'networks' => $topLevelNetworks->toArray(),
Expand Down
1 change: 0 additions & 1 deletion templates/compose/appwrite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ x-logging: &x-logging
options:
max-file: '5'
max-size: '10m'
version: '3'

services:
appwrite:
Expand Down
2 changes: 0 additions & 2 deletions templates/compose/authentik.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# logo: svgs/authentik.png
# port: 9000

version: "3.4"

services:
postgresql:
image: docker.io/library/postgres:12-alpine
Expand Down
1 change: 0 additions & 1 deletion templates/compose/glitchtip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# logo: svgs/glitchtip.png
# port: 8080

version: "3.8"
services:
postgres:
image: postgres:16-alpine
Expand Down
1 change: 0 additions & 1 deletion templates/compose/penpot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# slogan: Penpot is the first Open Source design and prototyping platform for product teams.
# tags: penpot,design,prototyping,figma,open,source

version: "3.5"
services:
frontend:
image: "penpotapp/frontend:latest"
Expand Down
1 change: 0 additions & 1 deletion templates/compose/plausible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# tags: analytics, privacy, google, alternative
# port: 8000

version: "3.3"
services:
plausible:
image: plausible/analytics:v2.0
Expand Down
8 changes: 4 additions & 4 deletions templates/service-templates.json

Large diffs are not rendered by default.

0 comments on commit fb80318

Please sign in to comment.