PHPackages                             ibra-akv/docker-jobs-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. ibra-akv/docker-jobs-bundle

ActiveSymfony-bundle[DevOps &amp; Deployment](/categories/devops)

ibra-akv/docker-jobs-bundle
===========================

Symfony bundle that offers a batch processing system with Docker.

6.0.1(3y ago)21361[2 issues](https://github.com/ibra-akv/docker-jobs-bundle/issues)MITPHPPHP &gt;=8.1.0

Since Mar 22Pushed 3y ago3 watchersCompare

[ Source](https://github.com/ibra-akv/docker-jobs-bundle)[ Packagist](https://packagist.org/packages/ibra-akv/docker-jobs-bundle)[ Docs](https://github.com/ibra-akv/docker-jobs-bundle)[ RSS](/packages/ibra-akv-docker-jobs-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (24)Used By (0)

Docker Jobs Bundle
==================

[](#docker-jobs-bundle)

> Symfony bundle that offers a **batch processing system** with **Docker**.

Uses Docker containers to run and handle your jobs.

- [Need to know](#need-to-know)
- [Docker Configuration](#docker-configuration)
- [Installation](#installation)
- [Configuration](#configuration)
- [Job Entity](#job-entity)
- [Bundle Configuration](#bundle-configuration)
- [Next steps](#next-steps)
    - [Console commands](docs/console.md)
        - [Job orchestration command](docs/console.md#job-orchestration-command)
        - [Job submission command](docs/console.md#job-submission-command)
        - [Stop job command](docs/console.md#stop-job-command)
        - [Orphan job cleaning command](docs/console.md#clean-orphan-jobs-command)
    - [Job Monitoring Dashboard](docs/dashboard.md)

Need to know
------------

[](#need-to-know)

All containers started by this bundle, are by default on the host's network.
So, if you need to connect to a local database, you can with the usual `localhost|127.0.0.1`.

Docker configuration
--------------------

[](#docker-configuration)

Docker Engine API must be exposed on a local port in order to be able to connect.

##### 1. Edit the `docker.service` which by default on debian is located at `/lib/systemd/system/docker.service`

[](#1-edit-the-dockerservice-which-by-default-on-debian-is-located-at-libsystemdsystemdockerservice)

From this:

```
# /lib/systemd/system/docker.service
...
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
...
```

To this:

```
# /lib/systemd/system/docker.service
...
ExecStart=/usr/bin/dockerd
...
```

##### 2. Edit `/etc/docker/daemon.json` to expose docker api at `127.0.0.1:2375`

[](#2-edit-etcdockerdaemonjson-to-expose-docker-api-at-1270012375)

Add `hosts` to the json file as next:

```
{
  ...
  "hosts": ["fd://", "tcp://127.0.0.1:2375"]
  ...
}
```

##### 3. Restart Docker completely

[](#3-restart-docker-completely)

```
systemctl daemon-reload
systemctl restart docker
service docker restart
```

#### Docker Image

[](#docker-image)

If not already done, you must create a Docker image which will be used to execute your jobs.

This bundle allows use of different images for each job but requires a default image to fallback on when no docker image is specified at launch.

Installation
------------

[](#installation)

When installing, you must specify the correct version of the bundle which coressponds to the Symfony version of your project.

```
# Symfony 6
composer require ibra-akv/docker-jobs-bundle:~6.0

# Symfony 5
composer require ibra-akv/docker-jobs-bundle:~5.0

# Symfony 4
composer require ibra-akv/docker-jobs-bundle:~4.0

# Symfony 3
composer require ibra-akv/docker-jobs-bundle:~3.0
```

Configuration
-------------

[](#configuration)

The configuration process is a bit lengthy, follow all the steps shown below.

- [Job Entity](#job-entity)
- [Bundle Configuration](#bundle-configuration)

---

### Job Entity

[](#job-entity)

You must create your Job entity and extend of BaseJob class.

```
