-
Notifications
You must be signed in to change notification settings - Fork 191
Upgrade to Django 3.2 LTS and Dockerize junction #757
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
01b8332
Upgrade Junction to Python 3.10 & Django 3.2 along with Social Login …
Bhandari423 ca0bf41
Fix unit tests add gunicorn (#748)
ananyo2012 9caf34e
Dockerize Junction (#749)
inovizz 4b238c6
Add SITE_PREFIX env variable for site url prefix
6721bf2
Fix smtp setup for sending verification emails
7f4d007
Fix conference moderator filter
4df0d5f
Fix template params fro absolute_url and is_proposal_reviewer
f306c6e
Add Django streamhandler logging with DEBUG (#763)
inovizz f24de39
Fix proposal comment template parameters
0717e0c
Add restart:always to containers
223c250
Fix comment creation error caused sparingly
9948041
Add password for Redis DB
af81c07
Fixes #765
e743e53
Add autocomplete_field for Proposal Reviewer to enable searcheable dr…
e4f687b
Update DEFAULT_FROM_EMAIL
130657d
Update common.py
inovizz abcff23
Added username field in edit profile form (Issue-769) (#771)
RajatRajdeep e08f527
Update Devlopment setup docs (#773)
ananyo2012 56ff281
Rename travis yml
8a445ff
Remove status badges from README
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# .dockerignore | ||
|
||
# Ignore Python bytecode files | ||
__pycache__/ | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
|
||
# Ignore virtual environment directories | ||
venv/ | ||
*.virtualenv/ | ||
.env/ | ||
|
||
# Ignore Django migration files | ||
*/migrations/*.pyc | ||
*/migrations/__pycache__/ | ||
|
||
# Ignore logs | ||
logs/ | ||
*.log | ||
|
||
# Ignore configuration files | ||
*.ini | ||
|
||
# Ignore user-specific files (e.g., editor settings) | ||
*.swp | ||
*.swo | ||
*.swn | ||
*.bak | ||
*.tmp | ||
*.sublime* | ||
*.vscode/ | ||
|
||
# Ignore local media files | ||
media/ | ||
|
||
# Ignore local database files (SQLite) | ||
*.sqlite3 | ||
*.sqlite3-journal | ||
|
||
# Ignore test coverage reports | ||
.coverage | ||
htmlcov/ | ||
|
||
# Ignore build artifacts and distribution files | ||
build/ | ||
dist/ | ||
*.egg-info/ | ||
*.egg | ||
*.wheel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
DEBUG=TRUE | ||
POSTGRES_USER=postgres | ||
POSTGRES_PASSWORD=junction | ||
POSTGRES_DB=junction | ||
HOST_NAME=db | ||
DB_PORT=5432 | ||
REDIS_HOST_PASSWORD=password | ||
BROKER_URL=redis://:password@redis:6379/0 | ||
CELERY_RESULT_BACKEND=redis://:password@redis:6379/0 | ||
SITE_PREFIX= | ||
SITE_NAME=junction | ||
SERVER_PORT=8888 | ||
GOOGLE_ANALYTICS_ID=google_analytics_id | ||
FACEBOOK_APP_ID=fb_app_id | ||
EMAIL_HOST_USER=email_host_user | ||
EMAIL_HOST_PASSWORD=email_host_pass | ||
SECRET_KEY=secret_key | ||
GITHUB_CLIENT_ID=github_client_id | ||
GITHUB_CLIENT_SECRET=github_client_secret | ||
GOOGLE_CLIENT_ID=google_oauth_client_id | ||
GOOGLE_CLIENT_SECRET=google_oauth_client_secret | ||
TWITTER_CONSUMER_KEY=twitter_consume_key | ||
TWITTER_CONSUMER_SECRET=twitter_consume_secret | ||
TWITTER_ACCESS_TOKEN_KEY=twitter_access_token | ||
TWITTER_ACCESS_TOKEN_SECRET=twitter_access_token_secret | ||
USE_ASYNC_FOR_EMAIL=boolean | ||
DJANGO_LOG_LEVEL=DEBUG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,3 +91,6 @@ qr_files/ | |
.vscode/ | ||
|
||
tmp/ | ||
|
||
# Env | ||
.env |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM python:3.10-slim-buster | ||
|
||
WORKDIR /code | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
gcc \ | ||
postgresql-client \ | ||
build-essential \ | ||
nodejs \ | ||
npm \ | ||
libpq-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY requirements.txt /code/ | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Install requirements for running tests | ||
COPY ./tools/requirements-test.txt /code/ | ||
RUN pip install --no-cache-dir -r requirements-test.txt | ||
|
||
RUN npm install -g yarn | ||
RUN npm install -g grunt-cli | ||
|
||
COPY . /code/ | ||
|
||
RUN chmod +x bin/install-static.sh | ||
RUN bin/install-static.sh | ||
# not getting used at this moment | ||
RUN chmod +x bin/wait-for-it.sh | ||
|
||
ENV PYTHONUNBUFFERED=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
cd junction/static | ||
yarn install | ||
grunt less | ||
cd ../.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# wait-for-it.sh: Wait for a service to be ready. | ||
|
||
set -e | ||
|
||
host="$1" | ||
port="$2" | ||
shift 2 | ||
cmd="$@" | ||
|
||
until PGPASSWORD="$POSTGRES_PASSWORD" psql -h "$host" -U "$POSTGRES_USER" -c '\q'; do | ||
>&2 echo "Postgres is unavailable - sleeping" | ||
sleep 1 | ||
done | ||
|
||
>&2 echo "Postgres is up - executing command" | ||
exec $cmd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
version: '3.8' | ||
|
||
services: | ||
db: | ||
image: postgres:15-alpine | ||
ports: | ||
- "5432:5432" | ||
restart: always | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data/ | ||
env_file: | ||
- .env | ||
|
||
redis: | ||
image: redis:latest | ||
ports: | ||
- "6379:6379" | ||
restart: always | ||
command: sh -c 'redis-server --requirepass ${REDIS_HOST_PASSWORD}' | ||
|
||
web: | ||
image: ananyo2012/junction:1.1 | ||
volumes: | ||
- .:/code | ||
ports: | ||
- "${SERVER_PORT}:${SERVER_PORT}" | ||
restart: always | ||
depends_on: | ||
- db | ||
env_file: | ||
- .env | ||
command: sh -c 'python manage.py migrate && python manage.py collectstatic --noinput --clear && gunicorn -c gunicorn.conf.py' | ||
|
||
celery: | ||
image: ananyo2012/junction:1.1 | ||
depends_on: | ||
- db | ||
- redis | ||
- web | ||
restart: always | ||
env_file: | ||
- .env | ||
command: sh -c 'celery -A junction worker -l info -E' | ||
|
||
volumes: | ||
postgres_data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: '3.8' | ||
|
||
services: | ||
test: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
command: sh -c pytest --cov=unit --cov=integrations --cov-report=html -v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
version: '3.8' | ||
|
||
services: | ||
db: | ||
image: postgres:15-alpine | ||
ports: | ||
- "5432:5432" | ||
restart: always | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data/ | ||
env_file: | ||
- .env | ||
|
||
redis: | ||
image: redis:latest | ||
ports: | ||
- "6379:6379" | ||
restart: always | ||
command: sh -c 'redis-server --requirepass ${REDIS_HOST_PASSWORD}' | ||
|
||
web: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
image: junction_local | ||
volumes: | ||
- .:/code | ||
ports: | ||
- "${SERVER_PORT}:${SERVER_PORT}" | ||
restart: always | ||
depends_on: | ||
- db | ||
env_file: | ||
- .env | ||
command: sh -c 'python manage.py migrate && python manage.py runsslserver 0.0.0.0:${SERVER_PORT}' | ||
|
||
celery: | ||
image: junction_local | ||
depends_on: | ||
- db | ||
- redis | ||
- web | ||
restart: always | ||
env_file: | ||
- .env | ||
command: sh -c 'celery -A junction worker -l info -E' | ||
|
||
volumes: | ||
postgres_data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.