forked from gCubeSystem/conductor-setup
32 lines
688 B
Django/Jinja
32 lines
688 B
Django/Jinja
version: '3.6'
|
|
|
|
services:
|
|
|
|
{{ postgres_service_name }}:
|
|
image: postgres
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
POSTGRES_USER: "{{ postgres_jdbc_user }}"
|
|
POSTGRES_PASSWORD: "{{ postgres_jdbc_pass }}"
|
|
POSTGRES_DB: "{{ postgres_jdbc_db }}"
|
|
{% if init_db %}
|
|
configs:
|
|
- source: db-init
|
|
target: "/docker-entrypoint-initdb.d/db-init.sql"
|
|
{% endif %}
|
|
networks:
|
|
- {{ conductor_network }}
|
|
deploy:
|
|
replicas: {{ postgres_replicas }}
|
|
placement:
|
|
constraints: [node.role == worker]
|
|
|
|
networks:
|
|
{{ conductor_network }}:
|
|
{% if init_db %}
|
|
configs:
|
|
db-init:
|
|
file: {{ target_path }}/conductor-db-init.sql
|
|
{% endif %}
|