https://github.com/pythoninthegrass/pulumi_docker
Use Pulumi's Docker provider to deploy containers locally and remotely.
https://github.com/pythoninthegrass/pulumi_docker
docker pulumi python
Last synced: 11 months ago
JSON representation
Use Pulumi's Docker provider to deploy containers locally and remotely.
- Host: GitHub
- URL: https://github.com/pythoninthegrass/pulumi_docker
- Owner: pythoninthegrass
- License: unlicense
- Created: 2024-10-30T19:28:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-07T22:51:01.000Z (12 months ago)
- Last Synced: 2025-02-21T21:49:55.906Z (11 months ago)
- Topics: docker, pulumi, python
- Language: Python
- Homepage:
- Size: 90.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pulumi_docker
Use Pulumi's Docker provider to deploy containers locally and remotely.
## Minimum Requirements
* [Pulumi](https://www.pulumi.com/docs/get-started/install/)
* [Python 3.11+](https://www.python.org/downloads/)
* [Docker](https://docs.docker.com/get-docker/)
## Recommended Requirements
* [asdf](https://asdf-vm.com/guide/getting-started.html)
## Quickstart
```bash
# default destination and stack
pulumi org set-default
# new project (empty directory other than .git)
pulumi new
# manage and view state
pulumi stack init dev
# tf analogues
pulumi preview
pulumi up
pulumi down
# info
pulumi about
# project config (Pulumi.yaml)
pulumi config
```
## Linting
```bash
# directory
mypy .
# file
mypy __main__.py
```
## TODO
* Replace fake creds in [services.py](services.py) with environment variables
* Add more outputs (cf. `mongo_container_name`)
* Research if it's possible to use both `unix:///var/run/docker.sock` and `ssh://user@remote-host:22` in the [Pulumi config](Pulumi.yml#L11)
* Set registry creds to use other than `docker.io` / access private registry
* `DOCKER_REGISTRY_USER`
* `DOCKER_REGISTRY_PASS`
* Local containers
* prometheus and grafana
* Remote containers (prometheus exporters)
| Name | Image | Port |
| ------------- | ----------------------------------------------------------- | ---- |
| node | "prom/node-exporter:latest" | 9100 |
| mongodb | "percona/mongodb_exporter:0.40" | 9216 |
| redis | "oliver006/redis_exporter:latest" | 9121 |
| elasticsearch | "quay.io/prometheuscommunity/elasticsearch-exporter:latest" | 9114 |
| kafka | "danielqsj/kafka-exporter:latest" | 9308 |
* Add tests
## Further Reading
* [Docker Provider](https://www.pulumi.com/docs/reference/pkg/docker/)
* [pulumi/pulumi-docker](https://github.com/pulumi/pulumi-docker/tree/master/examples)
* [Docker Build](https://www.pulumi.com/registry/packages/docker-build/)
* [Command](https://www.pulumi.com/registry/packages/command/)