aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <max@magorsch.de>2019-08-31 18:31:07 +0200
committerMax Magorsch <max@magorsch.de>2019-09-01 03:23:35 +0200
commit43d6930738063dcac7df523582a16b4eacd49814 (patch)
tree8a1f221f99d0d8c0724d91cc2c897835aca258ea
parentEnsure that the rake version bundled in Gemfile.lock is used (diff)
downloadpackages-5-43d6930738063dcac7df523582a16b4eacd49814.tar.gz
packages-5-43d6930738063dcac7df523582a16b4eacd49814.tar.bz2
packages-5-43d6930738063dcac7df523582a16b4eacd49814.zip
Added docker-compose.override.yml for development purposes
The newly added docker-compose.override.yml file overrides settings in docker-compose.yml for development purposes. In particular: - the source code will be mounted into the container for live reloading during the development - dejavu is used as gui for elasticsearch for debugging purposes - cors is enabled in elasticsearch for usage with dejavu These settings will automatically be used when executing: $ docker-compose up If you, however, don't want to use these settings (e.g. in production) use: $ docker-compose -f docker-compose.yml up For further information please refer to: https://docs.docker.com/compose/extends/#multiple-compose-files Signed-off-by: Max Magorsch <max@magorsch.de>
-rw-r--r--docker-compose.override.yml90
-rw-r--r--docker-compose.yml6
2 files changed, 95 insertions, 1 deletions
diff --git a/docker-compose.override.yml b/docker-compose.override.yml
new file mode 100644
index 0000000..1f2710b
--- /dev/null
+++ b/docker-compose.override.yml
@@ -0,0 +1,90 @@
+
+version: '3.2'
+# This file is used to override settings for development
+# purposes. In particular:
+# - the source code will be mounted into the container for
+# live reloading during the development
+# - dejavu is used as gui for elasticsearch for debugging purposes
+# - cors is enabled in elasticsearch for usage with dejavu
+#
+# These settings will automatically be used when executing:
+# $ docker-compose up
+#
+# If you, however, don't want to use these settings (e.g. in production) use:
+# $ docker-compose -f docker-compose.yml up
+#
+# Please refer to https://docs.docker.com/compose/extends/#multiple-compose-files
+# for further information.
+#
+services:
+ http-serving:
+ # Build from Dockerfile in .
+ build: .
+ ports:
+ - 5000
+ volumes:
+ - type: "bind"
+ source: "."
+ target: "/var/www/packages.gentoo.org/htdocs/"
+ environment:
+ # "Redis:port" and "elasticsearch:port" refer to sibling containers.
+ - REDIS_PROVIDER=REDIS_URL
+ - REDIS_URL=redis://redis:6379
+ - ELASTICSEARCH_URL=elasticsearch:9200
+ - RAILS_SERVE_STATIC_FILES=1
+ - RAILS_ENV=development
+ - MEMCACHE_URL="memcache:11211"
+ - SECRET_KEY_BASE=6c9710aeb74dd88ff1d1b8f4bd6d7d8e0f340905d0974400fffd7246714aa703cf7bf4a98c0bc90317a3b803b82c0f9371e18ada19fc4eed9d6118077a249f50
+ depends_on:
+ - redis
+ - elasticsearch
+ command: >
+ bash -c " bundler install
+ && bundle exec rake assets:precompile
+ && bundle exec thin start -p 5000"
+ sidekiq:
+ build: .
+ volumes:
+ - type: "bind"
+ source: "."
+ target: "/var/www/packages.gentoo.org/htdocs/"
+ environment:
+ - RAILS_ENV=development
+ - RAILS_SERVE_STATIC_FILES=1
+ - REDIS_URL=redis://redis:6379
+ - MEMCACHE_URL="memcache:11211"
+ - ELASTICSEARCH_URL=elasticsearch:9200
+ - SECRET_KEY_BASE=6c9710aeb74dd88ff1d1b8f4bd6d7d8e0f340905d0974400fffd7246714aa703cf7bf4a98c0bc90317a3b803b82c0f9371e18ada19fc4eed9d6118077a249f50
+ depends_on:
+ - redis
+ - elasticsearch
+ command: >
+ bash -c " bundler install
+ && bundle exec sidekiq -c 5"
+ memcache:
+ image: memcached:latest
+ ports:
+ - 11211
+ elasticsearch:
+ # TODO(antarus): We should build a docker image for this based on gentoo.
+ image: docker.elastic.co/elasticsearch/elasticsearch:6.0.1
+ container_name: elasticsearch
+ environment:
+ - discovery.type=single-node
+ - http.port=9200
+ - http.cors.enabled=true
+ - http.cors.allow-origin=http://localhost:1358,http://127.0.0.1:1358
+ - http.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
+ - http.cors.allow-credentials=true
+ - bootstrap.memory_lock=true
+ - 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
+ ports:
+ - 9200
+ # elasticsearch browser
+ dejavu:
+ image: appbaseio/dejavu:3.2.3
+ container_name: dejavu
+ ports:
+ - '1358:1358'
+ links:
+ - elasticsearch \ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
index 7c10720..d3d5d58 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,5 +1,5 @@
-version: '2'
+version: '3.2'
# p.g.o consists nominally of:
# A service to sync the tree to $TREE_DIR && update the index.
# The index updater simply submits work items into sidekiq.
@@ -11,6 +11,10 @@ version: '2'
# - Elasticsearch: runs the elasticsearch service.
# - Redis: Run Redis for Sidekiq.
# - Refresher: Syncs the package tree and pushes updates into sidekiq.
+#
+# For further information about usage during development / production
+# please refer to docker-compose.override.yml
+#
services:
http-serving:
# Build from Dockerfile in .