Giter Site home page Giter Site logo

gpkfr / docker-compose-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhajor/docker-compose-generator

0.0 3.0 0.0 11 KB

A docker compose generator, to create and deploy a project within a minute !

License: MIT License

Python 100.00%

docker-compose-generator's Introduction

Docker-compose-generator

Required

-Docker
-Docker-compose
-Python3

Before starting

The project goal is simple: winning time during the project initialization. As developers we made APIs, fronts, databases ... every weeks. Docker was amazing, allowed us to have various versions of sofwares (as php) without being a mess. Then came docker-compose, we were able to run many containers with just a single command. But the docker-compose.yml is annoying to write and 95% of time it's the same combo api, front, database. It's why I decided to take care of this by writing a script. My first thought was a simple 'sed'. However it wasn't enough, imagine this time you just want a single database, possible but quite dirty.
Here came docker-gen, you have to personalize the script for your usage. At the beginning of the script you have a list of images available, feel free to add some. Then came the default configuration of volumes, ports, envs... for api, front, db.
You don't need to change anything else in the file.

Usage

[MANDATORY] --name my-project the project name
[MANDATORY] --port 24000 the beginning port (it will be auto-incremented)
[OPTIONAL] --file docker-compose.yml the file to create default is docker-compose.yml
[OPTIONAL] --no-front do not create a front configuration
[OPTIONAL] --no-api do not create an api configuration
[OPTIONAL] --no-db do not create a db configuration
[OPTIONAL] --no-db-admin do not create a db administration configuration
[OPTIONAL] --api phalcon the image to use, need to be in the images available
[OPTIONAL] --front phalcon the image to use, need to be in the images available
[OPTIONAL] --db phalcon the image to use, need to be in the images available
[OPTIONAL] --db-admin phalcon the image to use, need to be in the images available

If you do --no-db you do not need to add --no-db-admin.

Example

python3 docker-gen.py --name mylittle-project --port 5300 --no-front --no-db
It will create an api configuration with default (phalcon). Now just do :
docker-compose up -d
It's running ! With the default configuration the api directory is ./api and needs a public directory inside.

Blog Article

Coming soon

Conclusion

Have fun !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.