automated push from the terminal
This commit is contained in:
140
compose.yaml
140
compose.yaml
@@ -1,29 +1,75 @@
|
|||||||
services:
|
services:
|
||||||
# The Django Web Application
|
|
||||||
web:
|
##########################################
|
||||||
container_name: card-players-unite-web
|
##
|
||||||
build:
|
## hosting / networking
|
||||||
context: .
|
##
|
||||||
dockerfile: Dockerfile
|
##########################################
|
||||||
|
|
||||||
|
hosting-proxy:
|
||||||
|
|
||||||
|
container_name: hosting-proxy
|
||||||
|
|
||||||
|
image: softwareshinobi/docker-container-proxy
|
||||||
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
ports:
|
|
||||||
- "8000:8000"
|
|
||||||
volumes:
|
volumes:
|
||||||
- .:/home/app/webapp
|
|
||||||
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||||
|
|
||||||
|
- /var/docker/nginx/html:/usr/share/nginx/html
|
||||||
|
|
||||||
|
- /var/docker/nginx/certs:/etc/nginx/certs
|
||||||
|
|
||||||
|
- /var/docker/nginx/vhost:/etc/nginx/vhost.d
|
||||||
|
|
||||||
|
ports:
|
||||||
|
|
||||||
|
- 33080:80
|
||||||
|
|
||||||
|
- 33443:443
|
||||||
|
|
||||||
|
logging:
|
||||||
|
|
||||||
|
options:
|
||||||
|
|
||||||
|
max-size: "10m"
|
||||||
|
|
||||||
|
max-file: "3"
|
||||||
|
|
||||||
|
hosting-letsencrypt:
|
||||||
|
|
||||||
|
container_name: hosting-letsencrypt
|
||||||
|
|
||||||
|
image: jrcs/letsencrypt-nginx-proxy-companion
|
||||||
|
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
volumes_from:
|
||||||
|
|
||||||
|
- hosting-proxy
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|
||||||
|
- /var/docker/nginx/acme:/etc/acme.sh
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_DB=maverickdb
|
|
||||||
- POSTGRES_USER=maverickdb
|
DEFAULT_EMAIL: troy@softwareshinobi.com
|
||||||
- POSTGRES_PASSWORD=maverickdb
|
|
||||||
- POSTGRES_HOST=card-players-unite-postgres
|
##########################################
|
||||||
depends_on:
|
##
|
||||||
- card-players-unite-postgres
|
## hosting / relational data
|
||||||
|
##
|
||||||
|
##########################################
|
||||||
|
|
||||||
card-players-unite-postgres:
|
card-players-unite-postgres:
|
||||||
|
|
||||||
container_name: card-players-unite-postgres
|
container_name: card-players-unite-postgres
|
||||||
|
|
||||||
image: postgres:14.1-alpine
|
image: postgres:14.1-alpine
|
||||||
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@@ -32,7 +78,7 @@ services:
|
|||||||
|
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|
||||||
- POSTGRES_DB=maverickdb
|
- POSTGRES_DB=maverickdb
|
||||||
|
|
||||||
@@ -40,10 +86,10 @@ services:
|
|||||||
|
|
||||||
- POSTGRES_PASSWORD=maverickdb
|
- POSTGRES_PASSWORD=maverickdb
|
||||||
|
|
||||||
## volumes:
|
## volumes:
|
||||||
##
|
##
|
||||||
## - /tmp/volume-data-postgres:/var/lib/postgresql/data
|
## - /tmp/volume-data-postgres:/var/lib/postgresql/data
|
||||||
|
|
||||||
card-players-unite-pgadmin:
|
card-players-unite-pgadmin:
|
||||||
|
|
||||||
container_name: card-players-unite-pgadmin
|
container_name: card-players-unite-pgadmin
|
||||||
@@ -53,17 +99,59 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
|
|
||||||
- card-players-unite-postgres
|
- card-players-unite-postgres
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
|
|
||||||
- "5480:80"
|
- "5480:80"
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|
||||||
PGADMIN_DEFAULT_EMAIL: lorem@loremipsum.com
|
PGADMIN_DEFAULT_EMAIL: lorem@loremipsum.com
|
||||||
|
|
||||||
PGADMIN_DEFAULT_PASSWORD: maverickdb
|
PGADMIN_DEFAULT_PASSWORD: maverickdb
|
||||||
|
|
||||||
## volumes:
|
## volumes:
|
||||||
##
|
##
|
||||||
## - /tmp/volume-data-pgadmin4:/var/lib/pgadmin
|
## - /tmp/volume-data-pgadmin4:/var/lib/pgadmin
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
##
|
||||||
|
## hosting / relational data
|
||||||
|
##
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
apis.cardplayersunited.com:
|
||||||
|
|
||||||
|
container_name: apis.cardplayersunited.com
|
||||||
|
|
||||||
|
image: dpage/pgadmin4
|
||||||
|
|
||||||
|
build:
|
||||||
|
|
||||||
|
context: .
|
||||||
|
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
|
||||||
|
- card-players-unite-postgres
|
||||||
|
|
||||||
|
ports:
|
||||||
|
|
||||||
|
- 8888:8000
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
|
||||||
|
- .:/home/app/webapp
|
||||||
|
|
||||||
|
environment:
|
||||||
|
|
||||||
|
- POSTGRES_DB=maverickdb
|
||||||
|
|
||||||
|
- POSTGRES_USER=maverickdb
|
||||||
|
|
||||||
|
- POSTGRES_PASSWORD=maverickdb
|
||||||
|
|
||||||
|
- POSTGRES_HOST=card-players-unite-postgres
|
||||||
|
|||||||
19
database.bash
Executable file
19
database.bash
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
reset
|
||||||
|
|
||||||
|
clear
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
docker compose -f database.yaml down --remove-orphans
|
||||||
|
|
||||||
|
docker compose -f database.yaml up -d --build
|
||||||
55
database.yaml
Normal file
55
database.yaml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
services:
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
##
|
||||||
|
## hosting / relational data
|
||||||
|
##
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
card-players-unite-postgres:
|
||||||
|
|
||||||
|
container_name: card-players-unite-postgres
|
||||||
|
|
||||||
|
image: postgres:14.1-alpine
|
||||||
|
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
ports:
|
||||||
|
|
||||||
|
- 5432:5432
|
||||||
|
|
||||||
|
environment:
|
||||||
|
|
||||||
|
- POSTGRES_DB=maverickdb
|
||||||
|
|
||||||
|
- POSTGRES_USER=maverickdb
|
||||||
|
|
||||||
|
- POSTGRES_PASSWORD=maverickdb
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
|
||||||
|
- /tmp/volumes/postgres:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
card-players-unite-pgadmin:
|
||||||
|
|
||||||
|
container_name: card-players-unite-pgadmin
|
||||||
|
|
||||||
|
image: dpage/pgadmin4
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
|
||||||
|
- card-players-unite-postgres
|
||||||
|
|
||||||
|
ports:
|
||||||
|
|
||||||
|
- "5480:80"
|
||||||
|
|
||||||
|
environment:
|
||||||
|
|
||||||
|
PGADMIN_DEFAULT_EMAIL: lorem@loremipsum.com
|
||||||
|
|
||||||
|
PGADMIN_DEFAULT_PASSWORD: maverickdb
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
|
||||||
|
- /tmp/volumes/pgadmin4:/var/lib/pgadmin
|
||||||
38
django.bash
Executable file
38
django.bash
Executable file
@@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
reset
|
||||||
|
|
||||||
|
clear
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
#python3 manage.py dumpdata
|
||||||
|
## This will IRREVERSIBLY DESTROY all data currently in the "maverickdb" database, and return each table to an empty state.
|
||||||
|
|
||||||
|
### python3 manage.py flush
|
||||||
|
|
||||||
|
### python3 manage.py sqlflush
|
||||||
|
|
||||||
|
#python3 manage.py sqlmigrate
|
||||||
|
|
||||||
|
##python3 manage.py sqlsequencereset
|
||||||
|
|
||||||
|
#python3 manage.py generateschema
|
||||||
|
|
||||||
|
python3 manage.py makemigrations
|
||||||
|
|
||||||
|
python3 manage.py migrate
|
||||||
|
|
||||||
|
#python3 manage.py squashmigrations bikes
|
||||||
|
|
||||||
|
#python3 manage.py optimizemigration
|
||||||
|
|
||||||
|
python3 manage.py runserver 0.0.0.0:8888
|
||||||
File diff suppressed because it is too large
Load Diff
25
provision.bash
Executable file
25
provision.bash
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 1. Setup/Re-setup Virtual Environment
|
||||||
|
|
||||||
|
python3 -m venv venv
|
||||||
|
|
||||||
|
source venv/bin/activate
|
||||||
|
|
||||||
|
# 2. Downgrade pip to bypass the invalid metadata error in django-rest-auth-forked
|
||||||
|
|
||||||
|
pip install "pip<24.1"
|
||||||
|
|
||||||
|
# 3. Install requirements (now it will ignore the parenthesis error)
|
||||||
|
|
||||||
|
if [ -f "requirements.txt" ]; then
|
||||||
|
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
pip install django
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Setup complete. Run 'source venv/bin/activate' to start working."
|
||||||
18
tournament/migrations/0002_alter_tournament_id.py
Normal file
18
tournament/migrations/0002_alter_tournament_id.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 6.0.2 on 2026-02-19 03:07
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('tournament', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='tournament',
|
||||||
|
name='id',
|
||||||
|
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||||
|
),
|
||||||
|
]
|
||||||
18
tournament/migrations/0003_alter_tournament_id.py
Normal file
18
tournament/migrations/0003_alter_tournament_id.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.28 on 2026-02-18 21:33
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('tournament', '0002_alter_tournament_id'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='tournament',
|
||||||
|
name='id',
|
||||||
|
field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
|
||||||
|
),
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user