Skip to content

Commit 1a8449d

Browse files
committed
Update docker-compose.yaml
1 parent 2f7376a commit 1a8449d

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

fastapi_forge/template/{{cookiecutter.project_name}}/docker-compose.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,25 @@ services:
100100
volumes:
101101
- {{ cookiecutter.project_name }}-redis-data:/bitnami/redis/data
102102
{% endif %}
103+
{%- if cookiecutter.use_rabbitmq -%}
104+
rabbitmq:
105+
image: rabbitmq:3-management
106+
container_name: {{ cookiecutter.project_name }}-rabbitmq
107+
ports:
108+
- "15672:15672"
109+
- "5672:5672"
110+
environment:
111+
RABBITMQ_DEFAULT_USER: user
112+
RABBITMQ_DEFAULT_PASS: password
113+
RABBITMQ_DEFAULT_VHOST: /
114+
healthcheck:
115+
test: rabbitmq-diagnostics -q check_running
116+
interval: 2s
117+
timeout: 3s
118+
retries: 40
119+
volumes:
120+
- {{ cookiecutter.project_name }}-rabbitmq-data:/var/lib/rabbitmq
121+
{% endif %}
103122
volumes:
104123
{%- if cookiecutter.use_postgres %}
105124
{{ cookiecutter.project_name }}-pg-data:
@@ -108,4 +127,8 @@ volumes:
108127
{%- if cookiecutter.use_redis %}
109128
{{ cookiecutter.project_name }}-redis-data:
110129
name: {{ cookiecutter.project_name }}-redis-data
130+
{% endif %}
131+
{%- if cookiecutter.use_rabbitmq -%}
132+
{{ cookiecutter.project_name }}-rabbitmq-data:
133+
name: {{ cookiecutter.project_name }}-rabbitmq-data
111134
{% endif %}

0 commit comments

Comments
 (0)