mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-13 13:14:53 +00:00
feat(supported-version): add service_preferences and support for php-fpm and nginx (#255)
This commit is contained in:
@@ -80,4 +80,29 @@ export const valkeyConfig: ServiceTemplate = {
|
||||
ports: ['6379:6379']
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Builds the nginx service config for the web tier. Takes the image
|
||||
* (sourced from the matrix entry's `nginx` field) and the runner
|
||||
* workspace path so the volume mount lands the Magento install at
|
||||
* `/var/www/html` inside the container. Pairs with `buildPhpFpmConfig`
|
||||
* — they're emitted together as the web tier.
|
||||
*/
|
||||
export const buildNginxConfig = (image: string, workspace: string): ServiceConfig => ({
|
||||
image,
|
||||
ports: ['80:80'],
|
||||
volumes: [`${workspace}:/var/www/html`],
|
||||
options: '--health-cmd "nginx -t" --health-interval=10s --health-retries=3 --health-timeout=5s --health-start-period=5s'
|
||||
});
|
||||
|
||||
/**
|
||||
* Builds the php-fpm service config for the web tier. Composes the
|
||||
* image from the matrix entry's `php` version (the mappia magento-php
|
||||
* image stream is the only widely-used Magento-aware php-fpm image).
|
||||
* Pairs with `buildNginxConfig`.
|
||||
*/
|
||||
export const buildPhpFpmConfig = (phpVersion: string, workspace: string): ServiceConfig => ({
|
||||
image: `mappia/magento-php:fpm-alpine${phpVersion}`,
|
||||
volumes: [`${workspace}:/var/www/html`]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user