diff --git a/docker-compose.yml b/docker-compose.yml index 29b19e7..f2e31c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,11 +11,11 @@ services: web: build: . image: hx/catchpy:dev - command: ["./wait-for-it.sh", "db:5432", "--", "python", "manage.py", "runserver", "0.0.0.0:8000"] + command: ["./wait-for-it.sh", "db:5432", "--", "./docker_entrypoint.sh"] volumes: - .:/code ports: - - "8000:8000" + - "9000:8000" depends_on: - db environment: diff --git a/docker_dotenv.env b/docker_dotenv.env index b6e2626..282b37c 100644 --- a/docker_dotenv.env +++ b/docker_dotenv.env @@ -16,3 +16,6 @@ CATCH_RESPONSE_LIMIT=200 # print seach times in steps CATCH_LOG_SEARCH_TIME="true" + +# docker hostname for catchpy +CATCHPY_ALLOWED_HOSTS='catchpy' diff --git a/docker_entrypoint.sh b/docker_entrypoint.sh new file mode 100755 index 0000000..4889e66 --- /dev/null +++ b/docker_entrypoint.sh @@ -0,0 +1,6 @@ +python manage.py migrate +python manage.py create_user --username user --password password --is_admin +python manage.py create_consumer_pair --consumer consumer --secret secret --expire_in_weeks 520 --no-update +python manage.py runserver 0.0.0.0:8000 + +