https://github.com/davidecavestro/dwservice-agent-docker
A way to containerize dwservice
https://github.com/davidecavestro/dwservice-agent-docker
docker docker-compose dwservice remote-control remote-shell
Last synced: 29 days ago
JSON representation
A way to containerize dwservice
- Host: GitHub
- URL: https://github.com/davidecavestro/dwservice-agent-docker
- Owner: davidecavestro
- License: mit
- Created: 2022-05-16T17:47:58.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-19T06:51:42.000Z (about 4 years ago)
- Last Synced: 2025-03-29T23:16:02.514Z (about 1 year ago)
- Topics: docker, docker-compose, dwservice, remote-control, remote-shell
- Language: Shell
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= dwservice-agent-docker - A way to containerize dwservice
== What's this?
This repo provides some config and a script to package the dwservice agent
into a docker image and run it.
== How to use it?
Create a new agent from https://github.com/dwservice/agent[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`.
== How does it work?
* 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
=== Container side
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
│ └── ...
└── ...
```
=== Host side
Relevant files as seen from the host
```
.
├── config
│ └── config.json # config file generated by dwservice
├── .env # your config
├── docker-compose.yml
├── Dockerfile
├── entrypoint.sh
└── ...
```
== License
This software is released under the MIT License.
All trademarks and product names are the property of their respective owners.