Code Monkey home page Code Monkey logo

docky's Introduction

Introduction

docky is a multi-purpose tool that adds some functionality for creating, running and managing docker-compose.yml files.

History & motivation

This project was initially created for building Odoo environments without effort based on docker-compose and docker.

Step by step, we have made it generic and now also use it for our rails and ruby development.

How it works

Docky integrates a default docker-compose file generator and simplifies running of docker containers.

Once your setup is done, docky depends on docker-compose and uses the same file. Except for some convenience features, you will mostly get the same results if you run the generated docker-compose.yml file through docker-compose or docky.

Requirements

docker-ce : https://docs.docker.com/install/ (or podman)

Installation

Docky is available from pypi

pip install docky
# or with pipx : pipx install docky --include-deps

Update Docky

pip install docky --upgrade
# or with pipx : pipx upgrade docky --include-deps

Usage: commands

docky init

Bootstraps a project using a template. This will ask you a series of questions to create customized .env and docker-compose.yml files that you can further edit. The template used is for running an Odoo server with some optional tools. Note that the template presumes that you have a running Traefik container on the "traefik" docker network.

You can also start from a template like this one : https://github.com/akretion/docky-odoo-template

For more information on other commands, use docky --help and check the documentation.

Usage: labels

The label docky.main.service and docky.user

docky.main.service: odoo
docky.user: odoo

Allows you to define the main service of your docker-compose.yml file, and to specify the command line user for the container when you run for example 'docky run'.

Usage: recommendations

  • Use ak to build your project.
  • When developing, if you are on several projects at once, it quickly becomes a mess to manage different ports of your containers. We recommend usage of Traefik. Here is an example docker-compose.yml file for local development purposes:
version: "3.7"
services:
    traefik:
    image: "traefik:v2.1"
    restart: always
    container_name: "traefik"
    command:
        - "--api.insecure=true"
        - "--providers.docker=true"
        - "--providers.docker.exposedbydefault=false"
        - "--entrypoints.web.address=:80"
    ports:
        - "127.0.0.1:80:80"
        - "127.0.0.1:8080:8080"
    volumes:
        - "/var/run/docker.sock:/var/run/docker.sock:ro"
    networks:
    - traefik

networks:
    traefik:
        name: traefik

More info about Traefik config on this repo: https://github.com/akretion/traefik-template

Troubleshooting

To avoid issues with line wrapping with "docky open" please use a version of docker > to 18.06.0-ce see : docker/compose#6151

Changelog

version 7.0.0

  • remove the need of docky config file in $HOME
  • use .env to be more compatible with docker-compose
  • improve templates
  • create init command
  • heavy refactoring

version 6.0.0

  • refactor remove proxy code and use traefik
  • remove docky.yml now you must use labels on services (see doc)
  • add option "--service=myservice" on docky run and docky open

version 5.0.0:

  • Resolve mac compatibility by remove proxy code that use a mounted version of etc/hosts now you need to install dnsmasq. This should also solve windows compatibilty by using the local dns https://stackoverflow.com/questions/138162/wildcards-in-a-windows-hosts-file?answertab=votes#tab-top
  • Solve issue with project name in multi user env (the name is based on user + directory name)
  • Add possibility to specify the service for run, open, logs, kill, down, restart, start cmd for example now you can do "docky open db" to open a terminal on the db server or you can restart a service like "docky restart varnish"
  • Solve issue with missing aliases name
  • Solve issue with missing environment variable with docky open (now we use a monkey-pacthed version of docker-compose exec)
  • Fix documentation build
  • Improve docky none specific cmd to a project to be run without project. For example, you can use docky help, docky proxy outside of a directory project

docky's People

Contributors

sebastienbeau avatar bealdav avatar rvalyi avatar bguillot avatar hparfr avatar sylvainc avatar ebii avatar pierrickbrun avatar legalsylvain avatar kevinkhao avatar chafique-delli avatar renatonlima avatar thibaultrey avatar

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.