Skip to content

Commit c4d8ba3

Browse files
ananyo2012Bhandari423Ananya MaitiinovizzRajatRajdeep
authored
Upgrade to Django 3.2 LTS and Dockerize junction (#757)
* Upgrade Junction to Python 3.10 & Django 3.2 along with Social Login Fix (#744) * Upgrade Python Version to 3.10 and Django Version 3.2 * Fix Github and Google Login/Signup * new package added to the requirements file * using f-strings Co-authored-by: @rohitchopra-epam * Fix unit tests add gunicorn (#748) * Fix failing tests, Add gunicorn Added nox method for running gunicorn * Pin dependencies --------- Co-authored-by: Ananya Maiti <[email protected]> * Dockerize Junction (#749) * Initial commit for Dockerization * Fix review comments and dockerignore * Update dev.py.sample with runsslserver * Fixes for using default settings module * Remove Dockerfile.celery and use image from junction web image * Update docker-compose.test.yml to not depend on postgres db * Add static asset compilation in Docker image * Add docker-compose.prod.yml and update server port configuration in application * Add social oauth env vars --------- Co-authored-by: Sanchit Balchandani <[email protected]> Co-authored-by: Ananya Maiti <[email protected]> * Add SITE_PREFIX env variable for site url prefix * Fix smtp setup for sending verification emails * Fix conference moderator filter * Fix template params fro absolute_url and is_proposal_reviewer * Add Django streamhandler logging with DEBUG (#763) * Fix proposal comment template parameters Fix userprofile dashboard url * Add restart:always to containers * Fix comment creation error caused sparingly Add review_comments=False for default comment view for logged in user * Add password for Redis DB * Fixes #765 Sort ProposalSection in descending order of creation date in ProposalSectionReviewer Add form * Add autocomplete_field for Proposal Reviewer to enable searcheable dropdown in add form * Update DEFAULT_FROM_EMAIL * Update common.py * Added username field in edit profile form (Issue-769) (#771) Co-authored-by: Rajat Rajdeep <[email protected]> * Update Devlopment setup docs (#773) * Update Devlopment setup docs * Instructions for setting up junction using Docker post junction upgrade. (#761) * Added instructions in the ReadMe file for setting up junction using Docker post junction upgrade. * Updated the psycopg version to resolve - SCRAM authentication requires libpq version 10 issue. --------- Co-authored-by: Rajat Rajdeep <[email protected]> --------- Co-authored-by: Ananya Maiti <[email protected]> Co-authored-by: Rajat Rajdeep <[email protected]> Co-authored-by: Rajat Rajdeep <[email protected]> * Rename travis yml * Remove status badges from README --------- Co-authored-by: Bhandari423 <[email protected]> Co-authored-by: Ananya Maiti <[email protected]> Co-authored-by: Sanchit Balchandani <[email protected]> Co-authored-by: Rajat Rajdeep <[email protected]> Co-authored-by: Rajat Rajdeep <[email protected]>
1 parent 69afa7a commit c4d8ba3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+907
-344
lines changed

.dockerignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# .dockerignore
2+
3+
# Ignore Python bytecode files
4+
__pycache__/
5+
*.pyc
6+
*.pyo
7+
*.pyd
8+
9+
# Ignore virtual environment directories
10+
venv/
11+
*.virtualenv/
12+
.env/
13+
14+
# Ignore Django migration files
15+
*/migrations/*.pyc
16+
*/migrations/__pycache__/
17+
18+
# Ignore logs
19+
logs/
20+
*.log
21+
22+
# Ignore configuration files
23+
*.ini
24+
25+
# Ignore user-specific files (e.g., editor settings)
26+
*.swp
27+
*.swo
28+
*.swn
29+
*.bak
30+
*.tmp
31+
*.sublime*
32+
*.vscode/
33+
34+
# Ignore local media files
35+
media/
36+
37+
# Ignore local database files (SQLite)
38+
*.sqlite3
39+
*.sqlite3-journal
40+
41+
# Ignore test coverage reports
42+
.coverage
43+
htmlcov/
44+
45+
# Ignore build artifacts and distribution files
46+
build/
47+
dist/
48+
*.egg-info/
49+
*.egg
50+
*.wheel

.env.sample

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
DEBUG=TRUE
2+
POSTGRES_USER=postgres
3+
POSTGRES_PASSWORD=junction
4+
POSTGRES_DB=junction
5+
HOST_NAME=db
6+
DB_PORT=5432
7+
REDIS_HOST_PASSWORD=password
8+
BROKER_URL=redis://:password@redis:6379/0
9+
CELERY_RESULT_BACKEND=redis://:password@redis:6379/0
10+
SITE_PREFIX=
11+
SITE_NAME=junction
12+
SERVER_PORT=8888
13+
GOOGLE_ANALYTICS_ID=google_analytics_id
14+
FACEBOOK_APP_ID=fb_app_id
15+
EMAIL_HOST_USER=email_host_user
16+
EMAIL_HOST_PASSWORD=email_host_pass
17+
SECRET_KEY=secret_key
18+
GITHUB_CLIENT_ID=github_client_id
19+
GITHUB_CLIENT_SECRET=github_client_secret
20+
GOOGLE_CLIENT_ID=google_oauth_client_id
21+
GOOGLE_CLIENT_SECRET=google_oauth_client_secret
22+
TWITTER_CONSUMER_KEY=twitter_consume_key
23+
TWITTER_CONSUMER_SECRET=twitter_consume_secret
24+
TWITTER_ACCESS_TOKEN_KEY=twitter_access_token
25+
TWITTER_ACCESS_TOKEN_SECRET=twitter_access_token_secret
26+
USE_ASYNC_FOR_EMAIL=boolean
27+
DJANGO_LOG_LEVEL=DEBUG

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,6 @@ qr_files/
9191
.vscode/
9292

9393
tmp/
94+
95+
# Env
96+
.env
File renamed without changes.

Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM python:3.10-slim-buster
2+
3+
WORKDIR /code
4+
5+
RUN apt-get update && \
6+
apt-get install -y --no-install-recommends \
7+
gcc \
8+
postgresql-client \
9+
build-essential \
10+
nodejs \
11+
npm \
12+
libpq-dev && \
13+
rm -rf /var/lib/apt/lists/*
14+
15+
COPY requirements.txt /code/
16+
RUN pip install --no-cache-dir -r requirements.txt
17+
18+
# Install requirements for running tests
19+
COPY ./tools/requirements-test.txt /code/
20+
RUN pip install --no-cache-dir -r requirements-test.txt
21+
22+
RUN npm install -g yarn
23+
RUN npm install -g grunt-cli
24+
25+
COPY . /code/
26+
27+
RUN chmod +x bin/install-static.sh
28+
RUN bin/install-static.sh
29+
# not getting used at this moment
30+
RUN chmod +x bin/wait-for-it.sh
31+
32+
ENV PYTHONUNBUFFERED=1

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
Junction
22
---
33

4-
[![Build Status](https://travis-ci.org/pythonindia/junction.svg)](https://travis-ci.org/pythonindia/junction) [![Coverage Status](https://coveralls.io/repos/pythonindia/junction/badge.svg?branch=master)](https://coveralls.io/r/pythonindia/junction?branch=master) [![Requirements Status](https://requires.io/github/pythonindia/junction/requirements.svg?branch=master)](https://requires.io/github/pythonindia/junction/requirements/?branch=master) [![Documentation Status](https://readthedocs.org/projects/in-junction/badge/?version=latest)](https://in-junction.readthedocs.io/en/latest/?badge=latest)
4+
[![Documentation Status](https://readthedocs.org/projects/in-junction/badge/?version=latest)](https://in-junction.readthedocs.io/en/latest/?badge=latest)
55

66
Junction is a software to manage proposals, reviews, schedule, feedback during conference.
77

8+
Project Setup using Docker
9+
--------------------------
10+
11+
Prerequisites:
12+
1. Docker: You can download and install Docker from the official website at https://www.docker.com/get-started.
13+
14+
Instructions:
15+
1. Copy the .env.sample file to a new .env file by running the following command: ```cp .env.sample .env```
16+
2. Create a local development settings file by running the following command: ```cp settings/dev.py.sample settings/dev.py```
17+
3. Build the junction_local image using the following command: ```docker build -t junction_local .```
18+
4. Start the project by running the following command: ```docker-compose up```
19+
5. Access the application at https://localhost:8888.
20+
821
Contributing
922
------------
1023

bin/install-static.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
cd junction/static
3+
yarn install
4+
grunt less
5+
cd ../..

bin/wait-for-it.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
# wait-for-it.sh: Wait for a service to be ready.
3+
4+
set -e
5+
6+
host="$1"
7+
port="$2"
8+
shift 2
9+
cmd="$@"
10+
11+
until PGPASSWORD="$POSTGRES_PASSWORD" psql -h "$host" -U "$POSTGRES_USER" -c '\q'; do
12+
>&2 echo "Postgres is unavailable - sleeping"
13+
sleep 1
14+
done
15+
16+
>&2 echo "Postgres is up - executing command"
17+
exec $cmd

docker-compose.prod.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
version: '3.8'
2+
3+
services:
4+
db:
5+
image: postgres:15-alpine
6+
ports:
7+
- "5432:5432"
8+
restart: always
9+
volumes:
10+
- postgres_data:/var/lib/postgresql/data/
11+
env_file:
12+
- .env
13+
14+
redis:
15+
image: redis:latest
16+
ports:
17+
- "6379:6379"
18+
restart: always
19+
command: sh -c 'redis-server --requirepass ${REDIS_HOST_PASSWORD}'
20+
21+
web:
22+
image: ananyo2012/junction:1.1
23+
volumes:
24+
- .:/code
25+
ports:
26+
- "${SERVER_PORT}:${SERVER_PORT}"
27+
restart: always
28+
depends_on:
29+
- db
30+
env_file:
31+
- .env
32+
command: sh -c 'python manage.py migrate && python manage.py collectstatic --noinput --clear && gunicorn -c gunicorn.conf.py'
33+
34+
celery:
35+
image: ananyo2012/junction:1.1
36+
depends_on:
37+
- db
38+
- redis
39+
- web
40+
restart: always
41+
env_file:
42+
- .env
43+
command: sh -c 'celery -A junction worker -l info -E'
44+
45+
volumes:
46+
postgres_data:

docker-compose.test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3.8'
2+
3+
services:
4+
test:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
command: sh -c pytest --cov=unit --cov=integrations --cov-report=html -v

0 commit comments

Comments
 (0)