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

Render deployment #33

Merged
merged 6 commits into from
Sep 24, 2023
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ COPY env.example .env
# Copy the application
COPY corpus/ .

RUN chmod +x start_livecycle.sh
RUN chmod +x start_dev.sh

EXPOSE 8000
ENTRYPOINT [ "/corpus/start_livecycle.sh" ]
ENTRYPOINT [ "/corpus/start_dev.sh" ]
1 change: 1 addition & 0 deletions corpus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ RUN pip install -r requirements.txt

COPY . .
RUN chmod +x ./start.sh
RUN chmod +x ./start_dev.sh
6 changes: 5 additions & 1 deletion corpus/corpus/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@
os.getenv("LIVECYCLE") is not None
)

ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
# TODO: Stricter host policies
ALLOWED_HOSTS = ["localhost", "127.0.0.1", ".onrender.com"]
CSRF_TRUSTED_ORIGINS = ["https://*.onrender.com"]
if os.environ["ENVIRONMENT"] == "PRODUCTION":
ALLOWED_HOSTS.append("ieee.nitk.ac.in")
CSRF_TRUSTED_ORIGINS.append("https://ieee.nitk.ac.in")

if os.getenv("LIVECYCLE"):
ALLOWED_HOSTS.append("*")
CSRF_TRUSTED_ORIGINS.append("*")

# Application definition

Expand Down
1 change: 1 addition & 0 deletions corpus/start_livecycle.sh → corpus/start_dev.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

python manage.py migrate --no-input
python manage.py loaddata config_db.json
DJANGO_SUPERUSER_PASSWORD=admin python manage.py createsuperuser --no-input --username admin --email admin@example.com
python manage.py runserver 0.0.0.0:8000