Skip to content

Commit

Permalink
Remove dead make commands. Change compose back to befault ports.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWorkman committed Jan 22, 2020
1 parent 69467f1 commit 39b03ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 154 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,3 @@ out.csv
*.db
/results
*.log


#
140 changes: 0 additions & 140 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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;
15 changes: 4 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,25 @@ 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:
build:
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

0 comments on commit 39b03ab

Please sign in to comment.