runabol / tork

A distributed workflow engine
https://tork.run
MIT License
599 stars 40 forks source link

Docker compose #252

Closed Auenc closed 11 months ago

Auenc commented 1 year ago

Is it possible to run Tork with docker compose?

For development purposes I was hoping to have a coordinator, and a worker, running via compose. However, when I try to make a request (http://localhost:8000/jobs for example) I get a socket hang up error.

Dockerfile

FROM ubuntu

WORKDIR /tork

RUN apt update
RUN apt install curl -y

ADD https://github.com/runabol/tork/releases/download/v0.1.22/default.release.tork_0.1.22_linux_amd64.tgz tork.tgz
RUN tar -zxf tork.tgz
RUN chmod +x ./tork

EXPOSE 8000

CMD ["./tork", "run", "coordinator"]

compose.yml

services:
  tork:
    build: ./
    ports:
      - "8000:8000"
ppcololo commented 1 year ago

compose:

version: "3.1"
services:
  postgres:
    container_name: postgres
    image: postgres:15.3
    restart: always
    expose:
      - 5432
    environment:
      POSTGRES_PASSWORD: tork
      POSTGRES_USER: tork
      POSTGRES_DB: tork
    volumes:
      - torkdata:/var/lib/postgresql/data
    networks:
      - tork

  tork:
    container_name: tork
    build: .
    restart: always
    expose:
      - 8000
    depends_on:
      - postgres
      - rabbitmq
    networks:
      - tork

  tork-web:
    image: runabol/tork-web
    restart: always
    container_name: tork-web
    ports:
      - 8100:8100
    environment:
      BACKEND_URL: "http://tork:8000"
    depends_on:
      - tork
    networks:
      - tork

  rabbitmq:
    container_name: rabbitmq
    image: rabbitmq:3-management
    restart: always
    environment:
      RABBITMQ_DEFAULT_USER: rabbit
      RABBITMQ_DEFAULT_PASS: rabbit
    ports:
      - 5672:5672
      - 15672:15672
    networks:
      - tork
    volumes:
      - rabbitmq:/var/lib/rabbitmq/mnesia/

volumes:
    torkdata:
    rabbitmq:

networks:
  tork:
    driver: bridge

Dockerfile

from alpine

RUN apk update && apk add wget tar
ADD https://github.com/runabol/tork/releases/download/0.1.40/tork_0.1.40_linux_amd64.tgz tork.tgz
RUN tar zxf tork.tgz
ADD config.toml .
ENTRYPOINT ./tork migration || ./tork run coordinator