Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation: fix account login/register #3603

Merged
merged 2 commits into from
Mar 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ RUN echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
RUN echo "workon invenio3" >> ~/.bashrc

# Start the Invenio application:
CMD ["/bin/bash", "-c", "invenio3 --debug run -h 0.0.0.0"]
CMD ["/bin/bash", "-c", "invenio3 run -h 0.0.0.0"]
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ include .inveniorc
include Vagrantfile
include docker-compose.yml
include Dockerfile
include nginx/Dockerfile

include *.rst
include *.sh
Expand All @@ -61,4 +62,5 @@ recursive-include docs Makefile
recursive-include misc *.py
recursive-include misc *.rst
recursive-include scripts *.sh
recursive-include tests *.py
recursive-include tests *.py
recursive-include nginx *.conf
29 changes: 26 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
# as an Intergovernmental Organization or submit itself to any jurisdiction.

web:
restart: "always"
build: .
command: /bin/bash -c "invenio3 --debug run -h 0.0.0.0"
command: /bin/bash -c "invenio3 run -h 0.0.0.0"
environment:
- PATH=/home/invenio/.virtualenvs/invenio3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
Expand All @@ -41,8 +42,8 @@ web:
- INVENIO_ELASTICSEARCH_HOST=elasticsearch
- INVENIO_RABBITMQ_HOST=rabbitmq
- INVENIO_WORKER_HOST=127.0.0.1
volumes:
- .:/code
volumes_from:
- static
links:
- postgresql
- redis
Expand All @@ -52,6 +53,7 @@ web:
- "5000:5000"

postgresql:
restart: "always"
image: postgres
environment:
- POSTGRES_USER=invenio3
Expand All @@ -61,18 +63,39 @@ postgresql:
- "25432:5432"

redis:
restart: "always"
image: redis
ports:
- "26379:6379"

elasticsearch:
restart: "always"
image: elasticsearch
ports:
- "29200:9200"
- "29300:9300"

rabbitmq:
restart: "always"
image: rabbitmq
ports:
- "24369:4369"
- "45672:25672"

nginx:
restart: "always"
build: ./nginx
ports:
- "80:80"
volumes_from:
- static
links:
- web

static:
restart: "no"
build: .
volumes:
- /home/invenio/.virtualenvs/invenio3/var/invenio3-instance/static
- /home/invenio/.virtualenvs/invenio3/src/invenio-theme/invenio_theme/static
user: invenio
27 changes: 27 additions & 0 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.

FROM nginx
RUN rm /etc/nginx/conf.d/default.conf
ADD invenio3.conf /etc/nginx/conf.d/
23 changes: 23 additions & 0 deletions nginx/invenio3.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
server {

listen 80;
server_name localhost;
charset utf-8;

location /static {
root /home/invenio/.virtualenvs/invenio3/var/invenio3-instance;
}

location / {
proxy_pass http://web:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

}
10 changes: 6 additions & 4 deletions scripts/create-instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,15 @@ echo "# Database" > ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INS
echo "SQLALCHEMY_DATABASE_URI='postgresql+psycopg2://${INVENIO_POSTGRESQL_DBUSER}:${INVENIO_POSTGRESQL_DBPASS}@${INVENIO_POSTGRESQL_HOST}:5432/${INVENIO_POSTGRESQL_DBNAME}'" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "# Redis" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "CACHE_TYPE='redis'" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "CACHE_REDIS_HOST='${INVENIO_REDIS_HOST}'" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "CACHE_REDIS_URL='redis://${INVENIO_REDIS_HOST}:6379/0'" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "ACCOUNTS_SESSION_REDIS_URL='redis://${INVENIO_REDIS_HOST}:6379/1'" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "# Celery" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "BROKER_URL='redis://${INVENIO_REDIS_HOST}:6379/0'" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "CELERY_RESULT_BACKEND='redis://${INVENIO_REDIS_HOST}:6379/1'" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "CELERY_ALWAYS_EAGER=True" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "CELERY_EAGER_PROPAGATES_EXCEPTIONS=True" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "BROKER_URL='amqp://guest:guest@${INVENIO_RABBITMQ_HOST}:5672//'" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "CELERY_RESULT_BACKEND='redis://${INVENIO_REDIS_HOST}:6379/2'" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "CELERY_ACCEPT_CONTENT=['json', 'msgpack', 'yaml']" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "# Elasticsearch" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
echo "SEARCH_ELASTIC_HOSTS='${INVENIO_ELASTICSEARCH_HOST}'" >> ../../var/${INVENIO_WEB_INSTANCE}-instance/${INVENIO_WEB_INSTANCE}.cfg
Expand Down
2 changes: 1 addition & 1 deletion scripts/start-instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ set -o errexit
set -o nounset

# sphinxdoc-start-application-begin
${INVENIO_WEB_INSTANCE} --debug run -h 0.0.0.0 &
${INVENIO_WEB_INSTANCE} run -h 0.0.0.0 &
# sphinxdoc-start-application-end