moved podman-compose up one level

This commit is contained in:
= 2025-01-19 15:32:29 -05:00
parent d50e79423f
commit 15dd9dfd60
6 changed files with 35 additions and 78 deletions

View File

@ -1,6 +1,8 @@
DEBUG=1 DEBUG=1
SECRET_KEY=Express.123 SECRET_KEY=Express.123
DJANGO_ALLOWED_HOSTS=192.168.0.234 localhost 127.0.0.1 [::1] DJANGO_ALLOWED_HOSTS=192.168.0.234 localhost 127.0.0.1 [::1]
DJANGO_SUPERUSER_USERNAME=admin
DJANGO_SUPERUSER_PASSWORD=GoodMorning123!
POSTGRESQL_ENGINE=django.db.backends.postgresql POSTGRESQL_ENGINE=django.db.backends.postgresql
POSTGRESQL_DATABASE=main_db POSTGRESQL_DATABASE=main_db
POSTGRESQL_USER=admin POSTGRESQL_USER=admin

39
Read.me
View File

@ -1,24 +1,37 @@
Read.me Read.me
Provide code for following program
Program runs on 5 containers using podman-dockerise Program runs on multiple containers using podman-dockercompose files and instances
First container is latest postgresql with pgadmin Here is the application structure
Second container is latest couchdb p00003 (venv)
Third container is latest django -p00003django
Fourth container is latest nodejs with latest react and latest redux -DockerFile
Fifth container is latest nginx which contains the landing page and serves static content -.entrypoint.sh
-JenkinsFile
-main (app1 - projects)
-accounts (app2 - apis for authentication and authorization)
-project_management
-requirements.txt
-manage.py
-p00003remix
-DockerFile
-JenkinsFile
-requirements.txt
-.entrypoint.sh
-podman-compose.yml (provides hashicorp p00003vault, p00003postgres, p00003pgadmin, p00003couchDB, p00003nginx, p00003django (depends on p00003postgres_), and p00003remix (depends on p00003couchDB))
Data is persisted in NFS file structure to be provided.
Program is wrapped with nginx static pages with reflex components embeded in it.
Application requires an email which will require confirmation through sending and confirming email. Once email is confirmed certificates and tokens will be generated and sent to safekeep to the first registered user. This user is also given full admin access to the application environment. I don't know how hashicorp works but there needs to be a possibility to regenerate the tokens they are misplaced or forgotten. But with each regeneration there needs to be an id that can't be changed so administrator knows that it was done.
All dynamic data is stored in an external nfs server defined in a configuration file for main django application.
Initial data that containers need is stored locally.
Program starts by welcoming user and displaying login or register page served by nginx.
Registration is by email which by default is noone@nowhere.net
Program will use a certificate system to secure communication between containers where root certificate passkey is the secret in settings page of the main django application
Django main application and apis it serves: Django main application and apis it serves:
Djano main application is the user directory, project directory, and RBAC definitions directory. Djano main application is the user directory, project directory, and RBAC definitions directory.
First time running the django application default user is admin and password is "GoodMorning123!" which has full administrative rights.
First time admin login to the django application default landing page is the program configuration page which has following required fields to complete: First time admin login to the django application default landing page is the program configuration page which has following required fields to complete:
-Company Name (only one company can exist but subsidieries can be created - 256 characters maximum) -Company Name (only one company can exist but subsidieries can be created - 256 characters maximum)
-First subsidiary name (organization unit responsible for administring the program - 256 characters maximum) -First subsidiary name (organization unit responsible for administring the program - 256 characters maximum)

View File

@ -5,4 +5,6 @@ urlpatterns = [
path('api/login/', UserLoginView.as_view(), name='login'), path('api/login/', UserLoginView.as_view(), name='login'),
path('api/logout/', UserLogoutView.as_view(), name='logout'), path('api/logout/', UserLogoutView.as_view(), name='logout'),
path('api/register/', UserRegistrationView.as_view(), name='welcome'), path('api/register/', UserRegistrationView.as_view(), name='welcome'),
path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
path('api/token/refresh', TokenRefreshView.as_view(), name='token_fresh'),
] ]

View File

@ -1,65 +0,0 @@
version: '3.8'
services:
p00003postgres:
container_name: p00003postgres
image: postgres:16.6
environment:
PUID: 1000
PGID: 1000
TZ: US/Eastern
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- backend
env_file:
- ./.p00003postgres.env
p00003pgadmin:
container_name: p00003pgadmin
image: dpage/pgadmin4:latest
environment:
PUID: 1000
PGID: 1000
TZ: US/Eastern
ports:
- "5080:80"
depends_on:
- p00003postgres
networks:
- backend
env_file:
- ./.p00003pgadm.env
volume:
- ./pgadmin_data:/var/lib/pgadmin
p00003django:
container_name: p00003django
environment:
PUID: 1000
PGID: 1000
TZ: US/Eastern
build: ./
volumes:
- ./:/usr/src/app/
ports:
- "8000:8000"
depends_on:
- p00003postgres
networks:
- backend
env_file:
- ./.p00003django.env
volumes:
postgres_data:
pgadmin_data:
p0003django:
networks:
backend:
driver: bridge

View File

@ -34,6 +34,7 @@ ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")
INSTALLED_APPS = [ INSTALLED_APPS = [
'rest_framework', 'rest_framework',
'rest_framework_simplejwt',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
@ -116,6 +117,9 @@ REST_FRAMEWORK = {
# or allow read-only access for unauthenticated users. # or allow read-only access for unauthenticated users.
'DEFAULT_PERMISSION_CLASSES': [ 'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.DjangoModelPermissions', 'rest_framework.permissions.DjangoModelPermissions',
],
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework_simplejwt.authentication.JWTAuthentication',
] ]
} }

View File

@ -1,6 +1,7 @@
asgiref==3.8.1 asgiref==3.8.1
Django==5.1.1 Django==5.1.1
djangorestframework==3.15.2 djangorestframework==3.15.2
djangorestframework-simplejwt==5.4.0
psycopg2-binary==2.9.10 psycopg2-binary==2.9.10
sqlparse==0.5.1 sqlparse==0.5.1
typing_extensions==4.12.2 typing_extensions==4.12.2