diff --git a/swarm/docker-compose.yml b/swarm/docker-compose.yml new file mode 100644 index 0000000..45f3762 --- /dev/null +++ b/swarm/docker-compose.yml @@ -0,0 +1,147 @@ +services: + fluentd: + image: kompira.azurecr.io/fluentd-with-rewrite-plugin:latest + volumes: + - /mnt/gluster/ke2me/configs/fluentd.conf:/fluentd/etc/fluent.conf:ro + - /mnt/gluster/ke2me/log:/var/log/fluentd + environment: + TZ: ${TZ:-Asia/Tokyo} + LOCAL_UID: ${LOCAL_UID:?LOCAL_UID must be set, try "export LOCAL_UID=$$(id -u $${USER})"} + LOCAL_GID: ${LOCAL_GID:?LOCAL_GID must be set, try "export LOCAL_GID=$$(id -g $${USER})"} + user: "${LOCAL_UID}:${LOCAL_GID}" + ports: + - "24224:24224" + - "24224:24224/udp" + deploy: + mode: replicated + replicas: 1 + kompira: + image: ${IMAGE_NAME:-kompira.azurecr.io/kompira-enterprise}:${IMAGE_TAG:-latest} + environment: + - DATABASE_URL=pgsql://kompira:kompira@${VIP:-host.docker.internal}:9999/kompira + - AMQP_URL=amqp://guest:guest@rabbitmq:5672 + - CACHE_URL=redis://redis:6379 + - LANGUAGE_CODE=${LANGUAGE_CODE:-ja} + - TZ=${TZ:-Asia/Tokyo} + volumes: + - /mnt/gluster/ke2me/var_home:/var/opt/kompira + - /mnt/gluster/ke2me/configs/kompira_audit.yaml:/opt/kompira/kompira_audit.yaml:ro + command: ["uwsgi"] + stop_signal: SIGINT + extra_hosts: + - host.docker.internal:host-gateway + logging: + driver: fluentd + options: + fluentd-async-connect: "true" + tag: "docker.{{.Name}}" + depends_on: + - fluentd + - kengine + deploy: + mode: global + kengine: + image: ${IMAGE_NAME:-kompira.azurecr.io/kompira-enterprise}:${IMAGE_TAG:-latest} + environment: + - DATABASE_URL=pgsql://kompira:kompira@${VIP:-host.docker.internal}:9999/kompira + - AMQP_URL=amqp://guest:guest@rabbitmq:5672 + - CACHE_URL=redis://redis:6379 + - LANGUAGE_CODE=${LANGUAGE_CODE:-ja} + - TZ=${TZ:-Asia/Tokyo} + volumes: + - /mnt/gluster/ke2me/var_home:/var/opt/kompira + - /mnt/gluster/ke2me/configs/kompira_audit.yaml:/opt/kompira/kompira_audit.yaml:ro + command: ["kompirad"] + ulimits: + nproc: 65535 + nofile: 65535 + extra_hosts: + - host.docker.internal:host-gateway + logging: + driver: fluentd + options: + fluentd-async-connect: "true" + tag: "docker.{{.Name}}" + depends_on: + - fluentd + - rabbitmq + deploy: + mode: global + jobmngrd: + image: ${IMAGE_NAME:-kompira.azurecr.io/kompira-enterprise}:${IMAGE_TAG:-latest} + environment: + - TZ=${TZ:-Asia/Tokyo} + volumes: + - /mnt/gluster/ke2me/var_home:/var/opt/kompira + - /mnt/gluster/ke2me/configs/kompira.conf:/opt/kompira/kompira.conf:ro + command: ["jobmngrd"] + ulimits: + nproc: 65535 + nofile: 65535 + logging: + driver: fluentd + options: + fluentd-async-connect: "true" + tag: "docker.{{.Name}}" + depends_on: + - fluentd + - rabbitmq + deploy: + mode: global + redis: + image: redis:7.2-alpine + environment: + - TZ=${TZ:-Asia/Tokyo} + volumes: + - kompira_redis:/data + logging: + driver: fluentd + options: + fluentd-async-connect: "true" + tag: "docker.{{.Name}}" + depends_on: + - fluentd + deploy: + mode: replicated + replicas: 1 + nginx: + image: nginx:1.25-alpine + environment: + - TZ=${TZ:-Asia/Tokyo} + volumes: + - /mnt/gluster/ke2me/var_home:/var/opt/kompira + - /mnt/gluster/ke2me/configs/nginx-default.conf:/etc/nginx/conf.d/default.conf:ro + ports: + - "80:80" + logging: + driver: fluentd + options: + fluentd-async-connect: "true" + tag: "docker.{{.Name}}" + depends_on: + - fluentd + - kompira + deploy: + mode: global + rabbitmq: + hostname: rabbitmq-server + image: rabbitmq:3.12-alpine + volumes: + - kompira_mq:/var/lib/rabbitmq # volume名を明示的に指定 (指定しないとハッシュ化された文字列のボリューム名が使われてゴミが増える) + environment: + RABBITMQ_DATA_DIR: /var/lib/rabbitmq # デフォルト値なので指定不要だが、ボリュームのマウントポイントと一致させるために明示的に指定しておく + TZ: ${TZ:-Asia/Tokyo} + logging: + driver: fluentd + options: + fluentd-async-connect: "true" + tag: "docker.{{.Name}}" + depends_on: + - fluentd + deploy: + mode: replicated + replicas: 1 + +volumes: + kompira_mq: + kompira_redis: