diff --git a/.gitignore b/.gitignore index 8a7b501..de71a08 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,3 @@ out.csv *.db /results *.log - - -# diff --git a/Makefile b/Makefile index 605168e..8927a89 100644 --- a/Makefile +++ b/Makefile @@ -63,143 +63,3 @@ up: ( \ $(COMPOSE) up; \ ) - -visual: -# Generate visual representation of database - $(call ECHO_GREEN, Generating a pretty image...) - (\ - $(COMPOSE) $(COMPOSE_CMD) graph_models --pygraphviz -a -g -o visualized.png; \ - ) - -dumpdata: -# Dump database to fixture file - $(call ECHO_RED, Database dump...) - (\ - $(COMPOSE) $(COMPOSE_CMD) dumpdata --exclude auth.permission --exclude contenttypes > ./initial_data.json; \ - ) - -shell: -# Run a local shell for debugging - $(call ECHO_GREEN, Opening iPython shell...) - ( \ - $(COMPOSE) $(COMPOSE_CMD) shell; \ - ) - - - - -###################### -# OLD -###################### - -r_crawl: -# Run ALL scrapy spiders - $(call ECHO_GREEN, Running Spiders Background Process... ) - (\ - cd recognition; \ - nohup python crawl.py & \ - ) - -crawl_spider: -# Run scrapy spider - $(call ECHO_GREEN, Running $(spider) spider... ) - (\ - scrapy crawl $(spider); \ - ) - -r_crawl_spider: -# Run scrapy spider - $(call ECHO_GREEN, Running $(spider) spider as background process... ) - (\ - nohup scrapy crawl $(spider) & \ - ) - -delete_sqlite: -# delete project db - ( \ - rm -rf db.sqlite3;\ - ) - -reset_migrations: -# delete all migrations furing initial development - ( \ - find . -path "*/migrations/*.py" -not -name "__init__.py" -delete; \ - find . -path "*/migrations/*.pyc" -delete; \ - ) - -map_points: - ( \ - python manage.py plot_lng_lat;\ - ) - -r_map_points: - ( \= - nohup python manage.py plot_lng_lat & \ - ) - -validate_urls: - ( \ - python manage.py valid_url;\ - ) - -r_validate_urls: - ( \ - nohup python manage.py valid_url & \ - ) - -find_contacts: - ( \ - nohup python manage.py find_contacts & \ - ) - -map_locations: - ( \ - nohup python manage.py plot_lng_lat & \ - ) - -rank: - # Start ranking centers - (\ - python manage.py rank; \ - ) - -r_rank: - # Start ranking centers - (\ - nohup python manage.py rank & \ - ) - -sql_dump: - # dump to fixtures file - (\ - rm -rf recognition/fixtures/dump.json; \ - ./manage.py dumpdata --natural-primary --natural-foreign > fixtures/dump.json ; \ - ) - - -initial_data: -# load initial db data - ( \ - pg_restore -p 5433 -d recognition --verbose initial_data.dump; \ - ) - -r_initial_data: -# load initial db data in vm - ( \ - sudo -u postgres pg_restore -p 5433 -d recognition --verbose initial_data.dump; \ - ) - - -createuser: - - # docker exec -it seeker_app echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@email.com', 'pass')" | ./manage.py shell; - ( \ - docker exec -it seeker_app python manage.py createsuperuser - ) - - - -# docker exec -it seeker_app python manage.py createsuperuser - - -# echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@email.com', 'pass')" | ./manage.py shell; diff --git a/docker-compose.yml b/docker-compose.yml index 6ffccf7..91e537d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,12 +14,8 @@ services: - POSTGRES_DB=postgres networks: - seeker - expose: - - "5435" ports: - - "5435:5435" - command: -p 5435 - # restart: on-failure + - "5432:5432" volumes: - postgresql-data:/var/lib/postgresql/data app: @@ -27,19 +23,16 @@ services: context: . dockerfile: ./Dockerfile container_name: seeker_app - command: sh -c "python manage.py collectstatic --no-input && python manage.py migrate && python manage.py runserver 0.0.0.0:8001" - # environment: - # - DJANGO_SETTINGS_MODULE=seeker.settings.local + command: sh -c "python manage.py collectstatic --no-input && python manage.py migrate && python manage.py runserver 0.0.0.0:8000" image: seeker_image hostname: app depends_on: - postgres expose: - - "8001" + - "8000" ports: - - "8001:8001" + - "8000:8000" volumes: - .:/usr/src/app networks: - seeker - # restart: on-failure