Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sadeghmohebbi/docker-compose-port-mapping-manager
adding or removing ports from docker compose yaml file via command line on the fly
https://github.com/sadeghmohebbi/docker-compose-port-mapping-manager
Last synced: 2 months ago
JSON representation
adding or removing ports from docker compose yaml file via command line on the fly
- Host: GitHub
- URL: https://github.com/sadeghmohebbi/docker-compose-port-mapping-manager
- Owner: sadeghmohebbi
- License: apache-2.0
- Created: 2021-01-15T07:24:31.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-01T01:24:44.000Z (about 3 years ago)
- Last Synced: 2024-04-24T14:58:34.063Z (9 months ago)
- Language: JavaScript
- Size: 24.4 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Docker Compose Port Mapping Manager
#### Video Demo: https://youtu.be/eeYDFllO8u0
#### Description:simply add or remove port mapping options via command line on docker compose yaml file. somtimes in devops process and bash scripts, you wanna enable or disable service published ports, this tool help us to achieve this purpose.
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. To learn more about all the features of Compose, see the list of features.
## Installation
you should have nodejs+npm installed environment, then you can install this package globaly via npm package manager
```bash
npm -g install docker-compose-port-mapping-manager
```## Usage
simple, fast and expressive command line options!note that, default input file is *docker-compose.yml* and default output file is *docker-compose.overwrite.yml* file. you can change them with ``--input`` and ``--output`` options.
```bash
docker-compose-port-mapping-manager --delete {port-mapping} --from {service-name}
docekr-compose-port-mapping-manager --add {port-mapping} --to {service-name}
```if we combine two commands above together, for example we want to add port 8080 mapping to 80 of nginx and remove existing 80:80 mapping, run command below:
```bashdocker-compose-port-mapping-manager --delete 80:80 --from nginx --add 8080:80 --to nginx
```## See Help
```bash
docker-compose-port-mapping-manager --helpadding or removing ports from docker compose yaml file via command line
Usage
$ docker-compose-port-mapping-managerOptions
--input, -i base docker compose yaml file (default: docker-compose.yml)
--output, -o target docker compose yaml file (default: docker-compose.override.yml)
--delete, -D delete ports action
--add, -A add ports mapping action
--to-service, --to selected service to add ports mapping option
--from-service, --from selected service to delete ports mapping optionExample:
remove 80->80 port mapping and add 8080->80 as a replacement to nginx service
$ docker-compose-port-mapping-manager --delete 80:80 --from nginx --add 8080:80 --to nginx
```that's all, i hope you enjoy this project. contribution is open for all :)
## License
``````