[docker] add a Dockerfile
authorDavid Douard <david.douard@logilab.fr>
Tue, 21 Jul 2015 18:00:44 +0200
changeset 55 13148a44982f
parent 54 9d76def7890a
child 56 ccacaf723c49
[docker] add a Dockerfile
Dockerfile
pillar.simple.example
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Dockerfile	Tue Jul 21 18:00:44 2015 +0200
@@ -0,0 +1,29 @@
+# VERSION 0.1
+# DOCKER-VERSION  1.3.3
+# AUTHOR:         David Douard <david.douard@logilab.fr>
+# DESCRIPTION:    Image with a cubicweb instance installed
+# TO_BUILD:       docker build -rm -t  .
+# TO_RUN:         docker run -p 8080:8080 cubicweb
+
+FROM logilab/salted_jessie
+
+# copy salt materials
+ADD cubicweb /srv/salt/cubicweb/
+ADD logilab /srv/salt/logilab/
+ADD _modules /srv/salt/_modules/
+ADD _states /srv/salt/_states/
+ADD pillar.simple.example /srv/pillar/example.sls
+
+# ensure masterless setup
+RUN echo "file_client: local/" > /etc/salt/minion.d/masterless.conf
+RUN echo "base:" > /srv/pillar/top.sls
+RUN echo " '*':" >> /srv/pillar/top.sls
+RUN echo " - example" >> /srv/pillar/top.sls
+RUN salt-call --local saltutil.sync_all && echo "ok"
+RUN salt-call --local state.sls cubicweb.postgres | tee log.txt && grep -e "Failed: *0" log.txt
+RUN salt-call --local state.sls cubicweb.instances | tee log.txt && grep -e "Failed: *0" log.txt
+
+EXPOSE 9001 # supervisord http endpoint
+EXPOSE 8080 # exact value depends on the pillar data
+
+CMD ["/usr/bin/supervisord", "--nodaemon"]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pillar.simple.example	Tue Jul 21 18:00:44 2015 +0200
@@ -0,0 +1,16 @@
+cubicweb_repo: production # set to acceptance if you want more recent versions of cubicweb 
+
+## Declare your cubicweb applications there
+cubicweb_apps:
+  test_app:
+    main:
+      database:
+        name: testapp
+        user: testuser
+        password: something cool
+      cwapp:
+        port: 8080
+        adminuser: admin
+        adminpass: admin
+        cubes:
+          blog: cubicweb-blog