Skip to content

Commit

Permalink
Docker Ok. Testing CI/CD should work
Browse files Browse the repository at this point in the history
  • Loading branch information
altf4arnold committed Mar 26, 2024
1 parent 74d9c61 commit c17a6fb
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,4 @@ cython_debug/
#.idea/
# Avoiding public key leakage
/config.py
/env.prod.db
6 changes: 5 additions & 1 deletion config.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS = []

DBUSER = "tldtest"

DBPASSWORD = "clubmate2010"
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ services:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- env.prod.db
volumes:
postgres_data:
3 changes: 3 additions & 0 deletions env.prod.db.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POSTGRES_USER=tldtest
POSTGRES_PASSWORD="clubmate2010"
POSTGRES_DB=tldtest-db
5 changes: 3 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
asgiref==3.7.2
build==1.1.1
build==1.0.3
click==8.1.7
Django==5.0.2
django-admin-extra-buttons==1.5.7
Expand All @@ -9,7 +9,8 @@ flake8==7.0.0
gunicorn==21.2.0
mccabe==0.7.0
packaging==23.2
pip-tools==7.4.0
pip-tools==7.3.0
psycopg2-binary==2.9.9
pycodestyle==2.11.1
pyflakes==3.2.0
pyproject_hooks==1.0.0
Expand Down
10 changes: 6 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --output-file=requirements.txt requirements.in
Expand All @@ -8,7 +8,7 @@ asgiref==3.7.2
# via
# -r requirements.in
# django
build==1.1.1
build==1.0.3
# via
# -r requirements.in
# pip-tools
Expand Down Expand Up @@ -40,7 +40,10 @@ packaging==23.2
# via
# -r requirements.in
# build
pip-tools==7.4.0
# gunicorn
pip-tools==7.3.0
# via -r requirements.in
psycopg2-binary==2.9.9
# via -r requirements.in
pycodestyle==2.11.1
# via
Expand All @@ -54,7 +57,6 @@ pyproject-hooks==1.0.0
# via
# -r requirements.in
# build
# pip-tools
rcssmin==1.1.1
# via
# -r requirements.in
Expand Down
25 changes: 19 additions & 6 deletions tldtest/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SCRET_KEY = config.SECRET_KEY
SECRET_KEY = config.SECRET_KEY

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config.DEBUG
Expand Down Expand Up @@ -78,12 +78,25 @@
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
if DEBUG is True:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
else:
DATABASES = {
"default": {
"ENGINE": ("django.db.backends.postgresql"),
"NAME": ("tldtest-db"),
"USER": (config.DBUSER),
"PASSWORD": (config.DBPASSWORD),
"HOST": ("db"),
"PORT": ("5432"),
}
}
}



# Password validation
Expand Down

0 comments on commit c17a6fb

Please sign in to comment.