From 7df44ef7139768609c8db3c9e0ff4d992515cca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Fri, 16 Oct 2015 20:02:09 +0200 Subject: [PATCH] remove the need for the data container recipe Volumes can be added through docker-compose.yml --- README.md | 8 ++------ dockeronify/templates/default/src/docker-compose.yml | 4 +++- sample_symfony_app/docker/Dockerfile | 5 ----- 3 files changed, 5 insertions(+), 12 deletions(-) delete mode 100644 sample_symfony_app/docker/Dockerfile diff --git a/README.md b/README.md index 2490a41..4f2a7b8 100644 --- a/README.md +++ b/README.md @@ -26,15 +26,11 @@ in your app. 1. Create a docker directory, in order to have a clean separation from the rest of the project. -2. Create a `Dockerfile`. It will contain the definition for -the data container of your application. It should consist only of `VOLUME` -statements, defining which files and directories will be shared with the containers. -Make sure to only use `VOLUMES` corresponding to containers you will be using. -3. Create any configuration file needed by the containers you intend to use. +2. Create any configuration file needed by the containers you intend to use. Configuration files could be part of the image rather than mounted on it, that is true, but having them as part of your application is great, because it makes explicit what will be needed when deploying the application. -4. Create a `docker-compose.yml` file and map the volume with paths on your host. +3. Create a `docker-compose.yml` file and map the volume with paths on your host. ## The containers diff --git a/dockeronify/templates/default/src/docker-compose.yml b/dockeronify/templates/default/src/docker-compose.yml index d5fe4cd..6c53a66 100644 --- a/dockeronify/templates/default/src/docker-compose.yml +++ b/dockeronify/templates/default/src/docker-compose.yml @@ -1,12 +1,14 @@ # This container is specific to the application. # It contains configuration and data for other containers. data: - build: ./docker + image: ubuntu:trusty volumes: - .:/srv - ./docker/conf/nginx_vhost.conf:/etc/nginx/sites-enabled/my_app.conf - .home-developer:/home/developer - $SSH_AUTH_SOCK:/tmp/agent.sock + - /var/lib/postgresql/data + - /var/lib/elasticsearch webserver: image: greg0ire/nginx diff --git a/sample_symfony_app/docker/Dockerfile b/sample_symfony_app/docker/Dockerfile deleted file mode 100644 index 10d9b8e..0000000 --- a/sample_symfony_app/docker/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM ubuntu:trusty - -VOLUME /srv -VOLUME /var/lib/postgresql/data -VOLUME /var/lib/elasticsearch