-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from Satyam0204/master
[UPDATE] Deploy Using Docker
- Loading branch information
Showing
9 changed files
with
137 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,12 +1,15 @@ | ||
SECRET_KEY=djangosecretkey | ||
CLIENT_ID=407408718192.apps.googleusercontent.com | ||
APP_ID=facebookoauthid | ||
APP_SECRET=facebookoauthsecret | ||
DOWNLOAD=passwordtodownloadleaderboard | ||
DB_NAME=df | ||
DB_USER=blahaja | ||
DB_PASSWORD=notmypass | ||
DB_HOST=localhost | ||
DB_PORT=5432 | ||
DEBUG=True | ||
GOOGLE_MAPS_API_KEY= | ||
SECRET_KEY= | ||
CLIENT_ID= | ||
APP_ID= | ||
APP_SECRET= | ||
DOWNLOAD= | ||
DB_NAME= | ||
DB_USER= | ||
DB_PASSWORD= | ||
DB_HOST= | ||
DB_PORT= | ||
DEBUG= | ||
GOOGLE_MAPS_API_KEY= | ||
POSTGRES_USER= | ||
POSTGRES_PASSWORD= | ||
POSTGRES_DB= |
This file contains 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 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,12 @@ | ||
FROM python:3.7-slim-buster | ||
|
||
RUN pip install --upgrade pip | ||
|
||
COPY ./requirements.txt . | ||
RUN pip install -r requirements.txt | ||
|
||
COPY . . | ||
|
||
# WORKDIR /app | ||
|
||
ENTRYPOINT [ "sh", "entrypoint.sh" ] |
This file contains 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 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,35 @@ | ||
version: '3.8' | ||
|
||
services: | ||
django_gunicorn: | ||
volumes: | ||
- static:/static | ||
env_file: | ||
- .env | ||
build: | ||
context: . | ||
ports: | ||
- "8000:8000" | ||
depends_on: | ||
- db | ||
|
||
db: | ||
image: postgres:13.0-alpine | ||
volumes: | ||
- db_data:/var/lib/postgresql/data/ | ||
env_file: | ||
- .env | ||
|
||
nginx: | ||
build: ./nginx | ||
volumes: | ||
- static:/static | ||
ports: | ||
- "80:80" | ||
depends_on: | ||
- db | ||
- django_gunicorn | ||
|
||
volumes: | ||
db_data: | ||
static: |
This file contains 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,7 @@ | ||
#!/bin/sh | ||
|
||
python manage.py makemigrations --no-input | ||
python manage.py migrate --no-input | ||
python manage.py collectstatic --no-input | ||
|
||
gunicorn Digital_Fortress_Backend.wsgi:application --bind 0.0.0.0:8000 |
This file contains 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,3 @@ | ||
FROM nginx:1.19.0-alpine | ||
|
||
COPY ./default.conf /etc/nginx/conf.d/default.conf |
This file contains 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,20 @@ | ||
upstream django_gunicorn { | ||
server django_gunicorn:8000; | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name dfapi.nitdgplug.org; | ||
|
||
location /static/ { | ||
alias /static/; | ||
} | ||
location / { | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_pass http://django_gunicorn; | ||
} | ||
|
||
} |
This file contains 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 |
---|---|---|
|
@@ -27,3 +27,4 @@ six==1.12.0 | |
sqlparse==0.3.0 | ||
toml==0.10.0 | ||
urllib3==1.25.3 | ||
gunicorn==20.0.4 |