WIP Persistent storage
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
"version": "2.0.31",
|
"version": "2.0.31",
|
||||||
"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",
|
||||||
"dev:stop": "docker-compose -f docker-compose-dev.yaml down",
|
"dev:stop": "docker-compose -f docker-compose-dev.yaml down",
|
||||||
"dev:logs": "docker-compose -f docker-compose-dev.yaml logs -f --tail 10",
|
"dev:logs": "docker-compose -f docker-compose-dev.yaml logs -f --tail 10",
|
||||||
"studio": "npx prisma studio",
|
"studio": "npx prisma studio",
|
||||||
|
@@ -135,6 +135,7 @@ export async function copyBaseConfigurationFiles(buildPack, workdir, buildId, ap
|
|||||||
RewriteRule ^(.+)$ index.php [QSA,L]
|
RewriteRule ^(.+)$ index.php [QSA,L]
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
|
await fs.writeFile(`${workdir}/entrypoint.sh`, `chown -R www-data /app`);
|
||||||
saveBuildLog({ line: 'Copied default configuration file for PHP.', buildId, applicationId });
|
saveBuildLog({ line: 'Copied default configuration file for PHP.', buildId, applicationId });
|
||||||
} else if (staticDeployments.includes(buildPack)) {
|
} else if (staticDeployments.includes(buildPack)) {
|
||||||
await fs.writeFile(
|
await fs.writeFile(
|
||||||
|
@@ -13,19 +13,21 @@ const createDockerfile = async (data, image): Promise<void> => {
|
|||||||
Dockerfile.push(`RUN chmod +x /usr/local/bin/install-php-extensions`);
|
Dockerfile.push(`RUN chmod +x /usr/local/bin/install-php-extensions`);
|
||||||
Dockerfile.push(`RUN /usr/local/bin/install-php-extensions ${data.phpModules.join(' ')}`);
|
Dockerfile.push(`RUN /usr/local/bin/install-php-extensions ${data.phpModules.join(' ')}`);
|
||||||
}
|
}
|
||||||
Dockerfile.push('RUN a2enmod rewrite');
|
// Dockerfile.push('RUN a2enmod rewrite');
|
||||||
Dockerfile.push('WORKDIR /var/www/html');
|
// Dockerfile.push(`ENV APACHE_DOCUMENT_ROOT /app`);
|
||||||
Dockerfile.push(`COPY .${baseDirectory || ''} /var/www/html`);
|
// Dockerfile.push(`RUN sed -ri -e 's!/var/www/html!/app!g' /etc/apache2/sites-available/*.conf`);
|
||||||
Dockerfile.push(`COPY /.htaccess /var/www/html/.htaccess`);
|
// Dockerfile.push(`RUN sed -ri -e 's!/var/www/!/app!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf`)
|
||||||
|
Dockerfile.push('WORKDIR /app');
|
||||||
|
Dockerfile.push(`COPY .${baseDirectory || ''} /app`);
|
||||||
|
Dockerfile.push(`COPY /.htaccess .`);
|
||||||
|
Dockerfile.push(`COPY /entrypoint.sh /entrypoint.sh`);
|
||||||
Dockerfile.push(`EXPOSE 80`);
|
Dockerfile.push(`EXPOSE 80`);
|
||||||
Dockerfile.push('CMD ["apache2-foreground"]');
|
|
||||||
Dockerfile.push('RUN chown -R www-data /var/www/html');
|
|
||||||
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
await fs.writeFile(`${workdir}/Dockerfile`, Dockerfile.join('\n'));
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function (data) {
|
export default async function (data) {
|
||||||
try {
|
try {
|
||||||
const image = 'php:apache';
|
const image = 'webdevops/php-nginx';
|
||||||
await createDockerfile(data, image);
|
await createDockerfile(data, image);
|
||||||
await buildImage(data);
|
await buildImage(data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@@ -272,7 +272,7 @@ export default async function (job) {
|
|||||||
`DOCKER_HOST=${host} docker run ${envFound && `--env-file=${workdir}/.env`} ${labels.join(
|
`DOCKER_HOST=${host} docker run ${envFound && `--env-file=${workdir}/.env`} ${labels.join(
|
||||||
' '
|
' '
|
||||||
)} --name ${imageId} --network ${docker.network} --restart always ${
|
)} --name ${imageId} --network ${docker.network} --restart always ${
|
||||||
volumes.length > 0 && volumes
|
volumes.length > 0 ? volumes : ''
|
||||||
} -d ${applicationId}:${tag}`
|
} -d ${applicationId}:${tag}`
|
||||||
);
|
);
|
||||||
if (stderr) console.log(stderr);
|
if (stderr) console.log(stderr);
|
||||||
|
Reference in New Issue
Block a user