How can I structure my docker projects for easy deployment?

后端 未结 2 589
暗喜
暗喜 2021-01-06 06:58

Right now I have multiple components of my application in the same folder linked together with a docker-compose

This works really well in development, but when I wa

2条回答
  •  -上瘾入骨i
    2021-01-06 07:21

    Check out the new (still experimental) docker-app (June 2018)

    It will allow you to push your docker-compose to DockerHub, as well as launch your app (through docker-compose) with settings variations between dev and prod.

    See example:

    You can create an Application Package based on this Compose file:

    $ docker-app init --single-file hello
    $ ls
    docker-compose.yml
    hello.dockerapp
    

    The new new file hello.dockerapp contains three YAML documents:

    • metadatas
    • the Compose file
    • settings for your application

    See "Sharing your application on the Hub"

    You can push any application to the Hub using docker-app push:

    $ docker-app push --namespace myHubUser --tag latest
    

    This command will create an image named myHubUser/hello.dockerapp:latest on your local Docker daemon, and push it to the Hub.

提交回复
热议问题