Skip to content

Commit

Permalink
Merge pull request #20 from coredotbin/healthcheck
Browse files Browse the repository at this point in the history
Add support for healthcheck
  • Loading branch information
ironicbadger authored Mar 16, 2024
2 parents 8a071e0 + 4642c4a commit 7a6f56a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ containers:
mem_limit: 512m
volumes:
- "{{ appdata_path }}/unifi:{{ container_config_path }}"
depends_on:
- service: mongodb
condition: service_started
include_global_env_vars: true
restart: "{{ unless_stopped }}"
- service_name: quassel
Expand All @@ -75,4 +78,4 @@ containers:
mem_limit: 128m
ports:
- "4242:4242"
```
```
20 changes: 18 additions & 2 deletions templates/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ services:
{% if container.depends_on is defined %}
depends_on:
{% for dependent in container.depends_on %}
{% if dependent is mapping %}
{{ dependent.service}}:
condition: {{ dependent.condition }}
{% else %}
- {{ dependent }}
{% endif %}
{% endfor %}
{% endif %}
{% if container.hostname is defined %}
Expand Down Expand Up @@ -160,8 +165,19 @@ services:
- {{ envfile }}
{% endfor %}
{% endif %}
{% if container.user is defined %}
user: {{ container.user }}
{% if container.healthcheck is defined %}
healthcheck:
test: "{{ container.healthcheck.test }}"
{% if container.healthcheck.interval is defined %}
interval: {{ container.healthcheck.interval }}
{% endif %}
{% if container.healthcheck.timeout is defined %}
timeout: {{ container.healthcheck.timeout }}
{% endif %}
{% if container.healthcheck.retries is defined %}
retries: {{ container.healthcheck.retries }}
{% endif %}
start_period: {{ container.healthcheck.start_period }}
{% endif %}
{% if container.restart is defined %}
restart: {{ container.restart }}
Expand Down

0 comments on commit 7a6f56a

Please sign in to comment.