This repo provides some config and a script to package the dwservice agent into a docker image and run it.
Create a new agent from dwservice UI and take note of the agent code.
Copy the .env.example
file into .env
, updating the AGENT_CODE variable
and adding the packages you need into the container.
Adapt the docker-compose.yml
entries as per your needs
(i.e. use privileged: true
, network_mode: "host"
, set a restart_policy
).
Finally run docker-compose build && docker-compose up
.
-
the config folder is mounted into the container at
/config
path -
the entrypoint.sh script looks for a file named
/config/config.json
-
if doesn’t exist or is not valid, the entrypoint launches the config generation routine passing the agent code obtained from the AGENT_CODE environment variable
-
the entrypoint creates at
/app/core/config.json
a symlink pointing to/config/config.json
-
the entrypoint launches the agent
Relevant files as seen within the container
/
├── config
│ └── config.json # 2. config file generated by dwservice
└── app
├── core
│ ├── agent.py # 4. agent launch routine
│ ├── config.json -> /config/config.json # 3. link to config file
│ └── ...
├── make
│ ├── create_config.py # 1. config generation routine
│ └── ...
└── ...