diff --git a/cmd/project/docker_build.go b/cmd/project/docker_build.go index 628c0c32..03c2ed60 100644 --- a/cmd/project/docker_build.go +++ b/cmd/project/docker_build.go @@ -125,6 +125,7 @@ func configureDockerfileTemplate(ctx context.Context, shopCfg *shop.Config) (map templateVars := map[string]interface{}{ "PHP": shopCfg.Docker.PHP, + "Variant": shopCfg.Docker.Variant, "ExcludePaths": shopCfg.Docker.ExcludePaths, "BuildEnv": strings.Join(buildEnvironments, " "), "RunEnv": strings.Join(runEnvironments, " "), diff --git a/cmd/project/templates/Dockerfile.tpl b/cmd/project/templates/Dockerfile.tpl index b95d0a50..871fb09c 100644 --- a/cmd/project/templates/Dockerfile.tpl +++ b/cmd/project/templates/Dockerfile.tpl @@ -1,7 +1,7 @@ #syntax=docker/dockerfile:1.4 # pin versions -FROM shopware/docker-base:{{.PHP.PhpVersion}} as base-image +FROM shopware/docker-base:{{.PHP.PhpVersion}}-{{ .Variant }} as base-image FROM ghcr.io/friendsofshopware/shopware-cli:latest-php-{{.PHP.PhpVersion}} as shopware-cli FROM base-image as base-extended diff --git a/shop/config.go b/shop/config.go index 92d435a4..1b48ee76 100644 --- a/shop/config.go +++ b/shop/config.go @@ -42,6 +42,7 @@ type ConfigDocker struct { PHP ConfigDockerPHP `yaml:"php,omitempty"` ExcludePaths []string `yaml:"exclude_paths,omitempty"` Hooks ConfigDockerHooks `yaml:"hooks,omitempty"` + Variant string `yaml:"variant,omitempty"` } type ConfigDockerHooks struct { @@ -171,6 +172,10 @@ func fillEmptyConfig(c *Config) *Config { } } + if c.Docker.Variant == "" { + c.Docker.Variant = "caddy" + } + return c } diff --git a/shop/shopware-project-schema.json b/shop/shopware-project-schema.json index 85e68fae..2be72589 100644 --- a/shop/shopware-project-schema.json +++ b/shop/shopware-project-schema.json @@ -39,6 +39,11 @@ "type": "array", "items": {"type": "string"} }, + "variant": { + "type": "string", + "enum": ["caddy", "fpm"], + "default": "caddy" + }, "hooks": { "type": "object", "additionalProperties": false,