Skip to content

Commit

Permalink
feat: #30 enable pdo_pgsql ext
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdan-shulha committed Jul 3, 2024
1 parent ca5065d commit a10c846
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM bitnami/php-fpm:latest

RUN echo "extension=pdo_pgsql.so" >> /opt/bitnami/php/etc/php.ini

RUN install_packages nodejs npm \
&& apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives

Expand Down
10 changes: 6 additions & 4 deletions app/Http/Controllers/SwarmController.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ public function updateDockerRegistries(Swarm $swarm, Request $request)
$tasks = [];

foreach ($swarmData->registries as $registry) {
$previous = $swarm->data->findRegistry($registry->dockerName);
if ($registry->sameAs($previous)) {
$registry->dockerName = $previous->dockerName;
$previous = $registry->dockerName ? $swarm->data->findRegistry($registry->dockerName) : null;
if ($previous) {
if ($registry->sameAs($previous)) {
$registry->dockerName = $previous->dockerName;

continue;
continue;
}
}

$registry->dockerName = dockerize_name('registry_r' . $swarmData->registriesRev . '_' . $registry->name);
Expand Down
8 changes: 4 additions & 4 deletions app/Models/Deployment.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function asNodeTasks(): array
],
],
],
'transport' => $this->getTransportOptions($caddy),
'transport' => $this->getTransportOptions($caddy, $process),
'upstreams' => [
[
'dial' => "{$process->name}.{$deployment->data->internalDomain}:{$caddy->targetPort}",
Expand Down Expand Up @@ -192,7 +192,7 @@ public function asNodeTasks(): array
];
}

protected function getTransportOptions(Caddy $caddy): array
protected function getTransportOptions(Caddy $caddy, Process $process): array
{
if ($caddy->targetProtocol === 'http') {
return [
Expand All @@ -203,8 +203,8 @@ protected function getTransportOptions(Caddy $caddy): array
if ($caddy->targetProtocol === 'fastcgi') {
return [
'protocol' => 'fastcgi',
'root' => $caddy->fastCgi->root,
'env' => collect($caddy->fastcgiVars)->reduce(fn ($carry, EnvVar $var) => [...$carry, $var->name => $var->value], []),
'root' => $process->fastCgi->root,
'env' => (object) collect($process->fastCgi->env)->reduce(fn ($carry, EnvVar $var) => [...$carry, $var->name => $var->value], []),
];
}

Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Services/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const props = defineProps({
>
<span v-if="service.latest_deployment.data.processes[0].caddy[0].publishedPort === 80">http://</span>
<span v-else-if="service.latest_deployment.data.processes[0].caddy[0].publishedPort === 443">https://</span>
<span class="text-black">{{ service.latest_deployment.processes[0].data.caddy[0].domain }}</span>
<span class="text-black">{{ service.latest_deployment.data.processes[0].caddy[0].domain }}</span>
<span>{{ service.latest_deployment.data.processes[0].caddy[0].path }}</span>
</span>
<span v-if="service.latest_deployment.data.processes[0].caddy.length > 1"
Expand Down
10 changes: 6 additions & 4 deletions resources/js/Pages/Services/Partials/DeploymentData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,14 @@ const hasFastCgiHandlers = computed(() => {
return model.value.processes[state.selectedProcessIndex['caddy']].caddy.some((caddy) => caddy.targetProtocol === 'fastcgi')
})
const defaultFastCgi = {
root: '',
env: [],
};
effect(() => {
model.value.processes[state.selectedProcessIndex['caddy']].fastCgi = hasFastCgiHandlers.value
? {
root: '',
env: [],
}
? (model.value.processes[state.selectedProcessIndex['caddy']].fastCgi || defaultFastCgi)
: null;
});
Expand Down

0 comments on commit a10c846

Please sign in to comment.