|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# |
| 3 | +# This file is part of CERN Open Data Portal. |
| 4 | +# Copyright (C) 2015, 2016, 2017 CERN. |
| 5 | +# |
| 6 | +# CERN Open Data Portal is free software; you can redistribute it |
| 7 | +# and/or modify it under the terms of the GNU General Public License as |
| 8 | +# published by the Free Software Foundation; either version 2 of the |
| 9 | +# License, or (at your option) any later version. |
| 10 | +# |
| 11 | +# CERN Open Data Portal is distributed in the hope that it will be |
| 12 | +# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | +# General Public License for more details. |
| 15 | +# |
| 16 | +# You should have received a copy of the GNU General Public License |
| 17 | +# along with CERN Open Data Portal; if not, write to the |
| 18 | +# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 19 | +# MA 02111-1307, USA. |
| 20 | +# |
| 21 | +# In applying this license, CERN does not |
| 22 | +# waive the privileges and immunities granted to it by virtue of its status |
| 23 | +# as an Intergovernmental Organization or submit itself to any jurisdiction. |
| 24 | + |
| 25 | +version: "2" |
| 26 | + |
| 27 | +services: |
| 28 | + |
| 29 | + # Use the following in your Python code to start debugging with wdb |
| 30 | + # ``` |
| 31 | + # import wdb |
| 32 | + # wdb.set_trace() |
| 33 | + # ``` |
| 34 | + wdb: |
| 35 | + image: kozea/wdb-server |
| 36 | + ports: |
| 37 | + - "1984:1984" |
| 38 | + |
| 39 | + web: |
| 40 | + restart: "always" |
| 41 | + image: cernopendata/static # Use this to make sure that COD3 Python-code image is built only once. |
| 42 | + depends_on: |
| 43 | + - static # Just to make sure that latest cernopendata/static -image is build before creating this container. |
| 44 | + command: "cernopendata run -h 0.0.0.0" # In case one needs to test/work with uWSGI comment out this. |
| 45 | + environment: |
| 46 | + - DEBUG=True |
| 47 | + - WDB_SOCKET_SERVER=wdb |
| 48 | + - WDB_NO_BROWSER_AUTO_OPEN=True |
| 49 | + - APP_SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://cernopendata:dbpass123@postgresql:5432/cernopendata |
| 50 | + - APP_CACHE_REDIS_HOST=redis |
| 51 | + - APP_CACHE_REDIS_URL=redis://redis:6379/0 |
| 52 | + - APP_ACCOUNTS_SESSION_REDIS_URL=redis://redis:6379/1 |
| 53 | + - APP_BROKER_URL=amqp://guest:guest@rabbitmq:5672/ # Celery 3 |
| 54 | + - APP_CELERY_BROKER_URL=amqp://guest:guest@rabbitmq:5672/ # Celery 4 |
| 55 | + - APP_CELERY_RESULT_BACKEND=redis://redis:6379/2 |
| 56 | + - APP_SEARCH_ELASTIC_HOSTS=elasticsearch |
| 57 | + - APP_PIDSTORE_DATACITE_TESTMODE=False |
| 58 | + - APP_PIDSTORE_DATACITE_DOI_PREFIX=10.5072 |
| 59 | + - APP_PIDSTORE_DATACITE_USERNAME=CERN.OPENDATA |
| 60 | + - APP_PIDSTORE_DATACITE_PASSWORD=CHANGE_ME |
| 61 | + - APP_PIDSTORE_LANDING_BASE_URL=http://opendata.cern.ch/record/ |
| 62 | + volumes: |
| 63 | + - ./cernopendata:/code/cernopendata |
| 64 | + - ./scripts:/code/scripts |
| 65 | + volumes_from: |
| 66 | + - static |
| 67 | + links: |
| 68 | + - postgresql |
| 69 | + - redis |
| 70 | + - elasticsearch |
| 71 | + - rabbitmq |
| 72 | + - wdb |
| 73 | + ports: |
| 74 | + - "5000:5000" |
| 75 | + |
| 76 | + worker: |
| 77 | + image: cernopendata/static # Use this to make sure that COD3 Python-code image is built only once. |
| 78 | + depends_on: |
| 79 | + - static # Just to make sure that latest cernopendata/static -image is build before creating this container. |
| 80 | + restart: "always" |
| 81 | + command: "celery worker -A cernopendata.celery --loglevel=INFO" |
| 82 | + environment: |
| 83 | + - DEBUG=True |
| 84 | + - WDB_SOCKET_SERVER=wdb |
| 85 | + - WDB_NO_BROWSER_AUTO_OPEN=True |
| 86 | + - APP_SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://cernopendata:dbpass123@postgresql:5432/cernopendata |
| 87 | + - APP_CACHE_REDIS_HOST=redis |
| 88 | + - APP_CACHE_REDIS_URL=redis://redis:6379/0 |
| 89 | + - APP_ACCOUNTS_SESSION_REDIS_URL=redis://redis:6379/1 |
| 90 | + - APP_BROKER_URL=amqp://guest:guest@rabbitmq:5672/ # Celery 3 |
| 91 | + - APP_CELERY_BROKER_URL=amqp://guest:guest@rabbitmq:5672/ # Celery 4 |
| 92 | + - APP_CELERY_RESULT_BACKEND=redis://redis:6379/2 |
| 93 | + - APP_SEARCH_ELASTIC_HOSTS=elasticsearch |
| 94 | + volumes: |
| 95 | + - ./cernopendata:/code/cernopendata |
| 96 | + - ./scripts:/code/scripts |
| 97 | + volumes_from: |
| 98 | + - static |
| 99 | + links: |
| 100 | + - postgresql |
| 101 | + - redis |
| 102 | + - elasticsearch |
| 103 | + - rabbitmq |
| 104 | + - wdb |
| 105 | + |
| 106 | + postgresql: |
| 107 | + restart: "always" |
| 108 | + image: postgres |
| 109 | + environment: |
| 110 | + - POSTGRES_USER=cernopendata |
| 111 | + - POSTGRES_DB=cernopendata |
| 112 | + - POSTGRES_PASSWORD=dbpass123 |
| 113 | + ports: |
| 114 | + - "5432:5432" |
| 115 | + |
| 116 | + redis: |
| 117 | + restart: "always" |
| 118 | + image: redis |
| 119 | + ports: |
| 120 | + - "6379:6379" |
| 121 | + |
| 122 | + elasticsearch: |
| 123 | + restart: "always" |
| 124 | + image: elasticsearch:5 |
| 125 | + environment: |
| 126 | + - bootstrap.memory_lock=true |
| 127 | + # set to reasonable values on production |
| 128 | + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" |
| 129 | + ports: |
| 130 | + - "9200:9200" |
| 131 | + - "9300:9300" |
| 132 | + |
| 133 | + rabbitmq: |
| 134 | + restart: "always" |
| 135 | + image: rabbitmq |
| 136 | + ports: |
| 137 | + - "4369:4369" |
| 138 | + - "5672:5672" |
| 139 | + |
| 140 | + nginx: |
| 141 | + restart: "always" |
| 142 | + build: ./nginx |
| 143 | + image: cernopendata/nginx |
| 144 | + ports: |
| 145 | + - "80:80" |
| 146 | + volumes: |
| 147 | + - ./cernopendata:/code/cernopendata |
| 148 | + - ./scripts:/code/scripts |
| 149 | + volumes_from: |
| 150 | + - static |
| 151 | + links: |
| 152 | + - web |
| 153 | + |
| 154 | + static: |
| 155 | + restart: "no" |
| 156 | + command: "echo 'Static running...'" |
| 157 | + build: |
| 158 | + context: . |
| 159 | + image: cernopendata/static |
| 160 | + volumes: |
| 161 | + - /usr/local/var/cernopendata/var/cernopendata-instance/static |
| 162 | + user: invenio |
0 commit comments