2022-06-04 23:36:18 +02:00
|
|
|
services:
|
|
|
|
{%- if ',' in cookiecutter.__component_list_slug -%}
|
|
|
|
{%- set components = cookiecutter.__component_list_slug.split(',') -%}
|
|
|
|
{% for component in components %}
|
|
|
|
{{ component }}-build:
|
2023-10-13 02:06:56 +02:00
|
|
|
# FIXME image name with or without slash? Docker Hub or private registry? With or without *_BUILD_DATE? FIXME
|
|
|
|
image: "{%- if cookiecutter.build == "yes" -%}{%- if loop.first -%}registry.example.com/project/{%- endif -%}{%- endif -%}{{ component }}:{%- if cookiecutter.build == "yes" -%}{%- if loop.first -%}${% raw %}{{% endraw %}{{ component.upper() }}_BUILD_DATE{% raw %}}{% endraw %}-{%- endif -%}{%- endif -%}${% raw %}{{% endraw %}{{ component.upper() }}_VERSION{% raw %}}{% endraw %}"
|
2022-06-04 23:36:18 +02:00
|
|
|
profiles: ["build", "build-{{ component }}"]
|
|
|
|
build:
|
|
|
|
context: "build-context/{{ component }}"
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
args:
|
|
|
|
EXAMPLE_ARG_FOR_DOCKERFILE: "${EXAMPLE_ARG_FROM_ENV_FILE}"
|
|
|
|
{{ component.upper() }}_VERSION: "${% raw %}{{% endraw %}{{ component.upper() }}_VERSION{% raw %}}{% endraw %}"
|
|
|
|
{%- endfor %}
|
|
|
|
{%- else %}
|
|
|
|
{{ cookiecutter.__component_list_slug }}-build:
|
2023-10-13 02:06:56 +02:00
|
|
|
# FIXME image name with or without slash? Docker Hub or private registry? With or without *_BUILD_DATE? FIXME
|
|
|
|
image: "{%- if cookiecutter.build == "yes" -%}registry.example.com/project/{%- endif -%}{{ cookiecutter.__component_list_slug }}:{%- if cookiecutter.build == "yes" -%}${% raw %}{{% endraw %}{{ cookiecutter.__component_list_slug.upper() }}_BUILD_DATE{% raw %}}{% endraw %}-{%- endif -%}${% raw %}{{% endraw %}{{ cookiecutter.__component_list_slug.upper() }}_VERSION{% raw %}}{% endraw %}"
|
2022-06-04 23:36:18 +02:00
|
|
|
profiles: ["build"]
|
|
|
|
build:
|
2023-12-24 02:56:03 +01:00
|
|
|
context: "build-context"
|
2022-06-04 23:36:18 +02:00
|
|
|
dockerfile: Dockerfile
|
|
|
|
args:
|
|
|
|
EXAMPLE_ARG_FOR_DOCKERFILE: "${EXAMPLE_ARG_FROM_ENV_FILE}"
|
|
|
|
{{ cookiecutter.__component_list_slug.upper() }}_VERSION: "${% raw %}{{% endraw %}{{ cookiecutter.__component_list_slug.upper() }}_VERSION{% raw %}}{% endraw %}"
|
|
|
|
{%- endif %}
|