@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "coolify",
|
"name": "coolify",
|
||||||
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
||||||
"version": "2.0.22",
|
"version": "2.0.23",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "docker-compose -f docker-compose-dev.yaml up -d && NODE_ENV=development svelte-kit dev --host 0.0.0.0",
|
"dev": "docker-compose -f docker-compose-dev.yaml up -d && NODE_ENV=development svelte-kit dev --host 0.0.0.0",
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ const createDockerfile = async (data, imageforBuild): Promise<void> => {
|
|||||||
|
|
||||||
Dockerfile.push(`FROM ${imageforBuild}`);
|
Dockerfile.push(`FROM ${imageforBuild}`);
|
||||||
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
||||||
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);
|
||||||
Dockerfile.push(`EXPOSE 80`);
|
Dockerfile.push(`EXPOSE 80`);
|
||||||
Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');
|
Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /usr/src/app');
|
||||||
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push(
|
Dockerfile.push(
|
||||||
`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${baseDirectory || ''} ./`
|
`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${baseDirectory || ''} ./`
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /usr/src/app');
|
||||||
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
if (secrets.length > 0) {
|
if (secrets.length > 0) {
|
||||||
secrets.forEach((secret) => {
|
secrets.forEach((secret) => {
|
||||||
if (secret.isBuildSecret) {
|
if (secret.isBuildSecret) {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /usr/src/app');
|
||||||
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
if (secrets.length > 0) {
|
if (secrets.length > 0) {
|
||||||
secrets.forEach((secret) => {
|
secrets.forEach((secret) => {
|
||||||
if (secret.isBuildSecret) {
|
if (secret.isBuildSecret) {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /usr/src/app');
|
||||||
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
if (secrets.length > 0) {
|
if (secrets.length > 0) {
|
||||||
secrets.forEach((secret) => {
|
secrets.forEach((secret) => {
|
||||||
if (secret.isBuildSecret) {
|
if (secret.isBuildSecret) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push('RUN a2enmod rewrite');
|
Dockerfile.push('RUN a2enmod rewrite');
|
||||||
Dockerfile.push('WORKDIR /var/www/html');
|
Dockerfile.push('WORKDIR /var/www/html');
|
||||||
Dockerfile.push(`COPY ./${baseDirectory || ''} /var/www/html`);
|
Dockerfile.push(`COPY ./${baseDirectory || ''} /var/www/html`);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
||||||
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);
|
||||||
Dockerfile.push(`EXPOSE 80`);
|
Dockerfile.push(`EXPOSE 80`);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const createDockerfile = async (data, image, name): Promise<void> => {
|
|||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /usr/src/app');
|
||||||
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/target target`);
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/target target`);
|
||||||
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/local/cargo /usr/local/cargo`);
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/local/cargo /usr/local/cargo`);
|
||||||
Dockerfile.push(`COPY . .`);
|
Dockerfile.push(`COPY . .`);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
||||||
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
if (secrets.length > 0) {
|
if (secrets.length > 0) {
|
||||||
secrets.forEach((secret) => {
|
secrets.forEach((secret) => {
|
||||||
if (secret.isBuildSecret) {
|
if (secret.isBuildSecret) {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
||||||
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);
|
||||||
Dockerfile.push(`EXPOSE 80`);
|
Dockerfile.push(`EXPOSE 80`);
|
||||||
Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');
|
Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
|
|
||||||
Dockerfile.push(`FROM ${image}`);
|
Dockerfile.push(`FROM ${image}`);
|
||||||
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
Dockerfile.push('WORKDIR /usr/share/nginx/html');
|
||||||
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);
|
Dockerfile.push(`COPY --from=${applicationId}:${tag}-cache /usr/src/app/${publishDirectory} ./`);
|
||||||
Dockerfile.push(`EXPOSE 80`);
|
Dockerfile.push(`EXPOSE 80`);
|
||||||
Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');
|
Dockerfile.push('CMD ["nginx", "-g", "daemon off;"]');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
function defaultBuildAndDeploy(packageManager) {
|
function defaultBuildAndDeploy(packageManager) {
|
||||||
return {
|
return {
|
||||||
installCommand:
|
installCommand:
|
||||||
packageManager === 'npm' ? `${packageManager} run install` : `${packageManager} install`,
|
packageManager === 'npm' ? `${packageManager} install` : `${packageManager} install`,
|
||||||
buildCommand:
|
buildCommand:
|
||||||
packageManager === 'npm' ? `${packageManager} run build` : `${packageManager} build`,
|
packageManager === 'npm' ? `${packageManager} run build` : `${packageManager} build`,
|
||||||
startCommand:
|
startCommand:
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export async function buildCacheImageWithNode(data, imageForBuild) {
|
|||||||
const Dockerfile: Array<string> = [];
|
const Dockerfile: Array<string> = [];
|
||||||
Dockerfile.push(`FROM ${imageForBuild}`);
|
Dockerfile.push(`FROM ${imageForBuild}`);
|
||||||
Dockerfile.push('WORKDIR /usr/src/app');
|
Dockerfile.push('WORKDIR /usr/src/app');
|
||||||
|
Dockerfile.push(`LABEL coolify.image=true`);
|
||||||
if (secrets.length > 0) {
|
if (secrets.length > 0) {
|
||||||
secrets.forEach((secret) => {
|
secrets.forEach((secret) => {
|
||||||
if (secret.isBuildSecret) {
|
if (secret.isBuildSecret) {
|
||||||
|
|||||||
@@ -620,6 +620,9 @@ export async function configureSimpleServiceProxyOn({ id, domain, port }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function configureSimpleServiceProxyOff(fqdn) {
|
export async function configureSimpleServiceProxyOff(fqdn) {
|
||||||
|
if (!fqdn) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const domain = getDomain(fqdn);
|
const domain = getDomain(fqdn);
|
||||||
const haproxy = await haproxyInstance();
|
const haproxy = await haproxyInstance();
|
||||||
await checkHAProxy(haproxy);
|
await checkHAProxy(haproxy);
|
||||||
|
|||||||
@@ -239,10 +239,16 @@ export default async function (job) {
|
|||||||
baseDirectory,
|
baseDirectory,
|
||||||
publishDirectory
|
publishDirectory
|
||||||
});
|
});
|
||||||
|
let envFound = false;
|
||||||
|
try {
|
||||||
|
envFound = !!(await fs.stat(`${workdir}/.env`));
|
||||||
|
} catch (error) {
|
||||||
|
//
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
saveBuildLog({ line: 'Deployment started.', buildId, applicationId });
|
saveBuildLog({ line: 'Deployment started.', buildId, applicationId });
|
||||||
const { stderr } = await asyncExecShell(
|
const { stderr } = await asyncExecShell(
|
||||||
`DOCKER_HOST=${host} docker run --env-file=${workdir}/.env ${labels.join(
|
`DOCKER_HOST=${host} docker run ${envFound && `--env-file=${workdir}/.env`} ${labels.join(
|
||||||
' '
|
' '
|
||||||
)} --name ${imageId} --network ${
|
)} --name ${imageId} --network ${
|
||||||
docker.network
|
docker.network
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export default async function () {
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
//Cleanup images that are not managed by coolify
|
// Cleanup images that are not managed by coolify
|
||||||
try {
|
try {
|
||||||
await asyncExecShell(
|
await asyncExecShell(
|
||||||
`DOCKER_HOST=${host} docker image prune --filter 'label!=coolify.image=true' -a -f`
|
`DOCKER_HOST=${host} docker image prune --filter 'label!=coolify.image=true' -a -f`
|
||||||
@@ -44,12 +44,12 @@ export default async function () {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
// Cleanup old images >3 days
|
||||||
// Cleanup dangling images
|
try {
|
||||||
try {
|
await asyncExecShell(`DOCKER_HOST=${host} docker image prune --filter "until=72h" -a -f`);
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker image prune -f`);
|
} catch (error) {
|
||||||
} catch (error) {
|
console.log(error);
|
||||||
console.log(error);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,7 @@
|
|||||||
title="Stop application"
|
title="Stop application"
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={!$session.isAdmin}
|
disabled={!$session.isAdmin}
|
||||||
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-green-600 hover:text-white"
|
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-red-500"
|
||||||
data-tooltip={$session.isAdmin
|
data-tooltip={$session.isAdmin
|
||||||
? 'Stop application'
|
? 'Stop application'
|
||||||
: 'You do not have permission to stop the application.'}
|
: 'You do not have permission to stop the application.'}
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
title="Rebuild application"
|
title="Rebuild application"
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={!$session.isAdmin}
|
disabled={!$session.isAdmin}
|
||||||
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-green-600 hover:text-white"
|
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:text-green-500"
|
||||||
data-tooltip={$session.isAdmin
|
data-tooltip={$session.isAdmin
|
||||||
? 'Rebuild application'
|
? 'Rebuild application'
|
||||||
: 'You do not have permission to rebuild application.'}
|
: 'You do not have permission to rebuild application.'}
|
||||||
@@ -182,7 +182,7 @@
|
|||||||
title="Build and start application"
|
title="Build and start application"
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={!$session.isAdmin}
|
disabled={!$session.isAdmin}
|
||||||
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-green-600 hover:text-white"
|
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-green-500"
|
||||||
data-tooltip={$session.isAdmin
|
data-tooltip={$session.isAdmin
|
||||||
? 'Build and start application'
|
? 'Build and start application'
|
||||||
: 'You do not have permission to Build and start application.'}
|
: 'You do not have permission to Build and start application.'}
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
title="Stop database"
|
title="Stop database"
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={!$session.isAdmin}
|
disabled={!$session.isAdmin}
|
||||||
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-purple-600 hover:text-white"
|
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-red-500"
|
||||||
data-tooltip={$session.isAdmin
|
data-tooltip={$session.isAdmin
|
||||||
? 'Stop database'
|
? 'Stop database'
|
||||||
: 'You do not have permission to stop the database.'}
|
: 'You do not have permission to stop the database.'}
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
title="Start database"
|
title="Start database"
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={!$session.isAdmin}
|
disabled={!$session.isAdmin}
|
||||||
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-purple-600 hover:text-white"
|
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-green-500"
|
||||||
data-tooltip={$session.isAdmin
|
data-tooltip={$session.isAdmin
|
||||||
? 'Start database'
|
? 'Start database'
|
||||||
: 'You do not have permission to start the database.'}
|
: 'You do not have permission to start the database.'}
|
||||||
|
|||||||
@@ -71,12 +71,14 @@
|
|||||||
class:text-stone-600={loading}
|
class:text-stone-600={loading}
|
||||||
class:bg-coollabs={!loading}>{loading ? 'Authenticating...' : 'Login'}</button
|
class:bg-coollabs={!loading}>{loading ? 'Authenticating...' : 'Login'}</button
|
||||||
>
|
>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
on:click|preventDefault={() => goto('/register')}
|
on:click|preventDefault={() => goto('/register')}
|
||||||
class="hover:opacity-90 text-white">Register</button
|
class="bg-transparent hover:bg-coolgray-300 text-white ">Register</button
|
||||||
>
|
>
|
||||||
<button class="bg-transparent" on:click|preventDefault={() => goto('/reset')}
|
<button
|
||||||
>Reset password</button
|
class="bg-transparent hover:bg-coolgray-300"
|
||||||
|
on:click|preventDefault={() => goto('/reset')}>Reset password</button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
title="Stop Service"
|
title="Stop Service"
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={!$session.isAdmin}
|
disabled={!$session.isAdmin}
|
||||||
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-pink-600 hover:text-white"
|
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-red-500"
|
||||||
data-tooltip={$session.isAdmin
|
data-tooltip={$session.isAdmin
|
||||||
? 'Stop Service'
|
? 'Stop Service'
|
||||||
: 'You do not have permission to stop the service.'}
|
: 'You do not have permission to stop the service.'}
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
title="Start Service"
|
title="Start Service"
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={!$session.isAdmin}
|
disabled={!$session.isAdmin}
|
||||||
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 hover:bg-pink-600 hover:text-white"
|
class="icons bg-transparent tooltip-bottom text-sm flex items-center space-x-2 text-green-500"
|
||||||
data-tooltip={$session.isAdmin
|
data-tooltip={$session.isAdmin
|
||||||
? 'Start Service'
|
? 'Start Service'
|
||||||
: 'You do not have permission to start the service.'}
|
: 'You do not have permission to start the service.'}
|
||||||
|
|||||||
Reference in New Issue
Block a user