cookiecutter-ansible-role-d.../ansible-role-{{cookiecutter.app_name}}/templates/docker-compose.yml.j2
Laur Ivan bda1f187c5 feat: Better default configuration.
Add multiple files copy via variables.
Add service skeleton.
Add image and port versions.
2023-04-27 22:05:41 +02:00

24 lines
846 B
Django/Jinja

# {{ cookiecutter.app_name }} docker compose
version: '3.9'
services:
{{ cookiecutter.app_name}}:
image: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_image {% raw %}}}{% endraw %}"
container_name: {{ cookiecutter.app_name }}-service
restart: always
env_file:
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_config_path | expanduser {% raw %}}}{% endraw %}/env.{{ cookiecutter.app_name }}.conf"
ports:
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_http_port {% raw %}}}{% endraw %}"
# Add more ports if necessary
networks:
- {{ cookiecutter.app_name }}-net
# optional
volumes:
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_http_port {% raw %}}}{% endraw %}"
depends_on:
- other
- services
networks:
{{ cookiecutter.app_name }}-net