diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 495bc8bf057d73608757b7a6a91fe9169577b7aa..0000000000000000000000000000000000000000 --- a/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM python:3 -ENV PYTHONBUFFERED=1 -WORKDIR / -COPY requirements.txt ./ -RUN pip install --progress-bar off -r requirements.txt diff --git a/docker-compose.yml b/docker-compose.yml index e0ccc0ba1d3c4acb7a668a16077c33262e90bcc1..ec29e6619553ddee56fcb56975ddf84815337f52 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,40 +1,46 @@ services: register: - build: . + build: + context: . + dockerfile: register/Dockerfile container_name: register - command: bash -c "python src/register/manage.py makemigrations && python src/register/manage.py migrate && python src/register/manage.py runserver 0.0.0.0:8001" + command: bash -c "python register/manage.py makemigrations && python register/manage.py migrate && python register/manage.py runserver 0.0.0.0:8000" volumes: - - .:/src + - .:/com3014-team3 ports: - - "8001:8001" - depends_on: - - pgdb + - 8000:8000 main: - build: . + build: + context: . + dockerfile: main/Dockerfile container_name: main - command: bash -c "python src/main/manage.py makemigrations contact && python src/main/manage.py migrate contact && python src/main/manage.py runserver 0.0.0.0:8000" + command: bash -c "python main/manage.py makemigrations contact && python main/manage.py migrate contact && python main/manage.py runserver 0.0.0.0:8001" volumes: - - .:/src + - .:/com3014-team3 ports: - - "8000:8000" + - "8001:8001" depends_on: - pgdb posts: - build: . + build: + context: . + dockerfile: post/Dockerfile container_name: posts - command: bash -c "python src/post/manage.py makemigrations postapp && python src/post/manage.py migrate postapp && python src/post/manage.py runserver 0.0.0.0:8002" + command: bash -c "python post/manage.py makemigrations postapp && python post/manage.py migrate postapp && python post/manage.py runserver 0.0.0.0:8002" volumes: - - .:/src + - .:/com3014-team3 ports: - "8002:8002" depends_on: - pgdb profiles: - build: . + build: + context: . + dockerfile: profiles/Dockerfile container_name: profiles - command: bash -c "python src/profiles/manage.py makemigrations profileapp && python src/profiles/manage.py migrate profileapp && python src/profiles/manage.py runserver 0.0.0.0:8003" + command: bash -c "python profiles/manage.py makemigrations profileapp && python profiles/manage.py migrate profileapp && python profiles/manage.py runserver 0.0.0.0:8003" volumes: - - .:/src + - .:/com3014-team3 ports: - "8003:8003" depends_on: @@ -48,6 +54,5 @@ services: - POSTGRES_PASSWORD=postgres volumes: - pgdata:/postgresql/data - volumes: pgdata: diff --git a/main/Dockerfile b/main/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..757de609d4fd9895ab6fb79bd1620786c9094991 --- /dev/null +++ b/main/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3 +LABEL maintainer = "COM3014-Team3" +WORKDIR /com3014-team3 +ENV PYTHONBUFFERED=1 +COPY requirements.txt ./ +COPY static ./ +COPY templates ./ +COPY media ./ +RUN pip install -r requirements.txt +COPY main ./ \ No newline at end of file diff --git a/main/main/__pycache__/settings.cpython-312.pyc b/main/main/__pycache__/settings.cpython-312.pyc index 59b6b26d9549366b7c54263b9655b2b101db3869..033036470e6ec1146d821738651688fa6b8024c9 100644 Binary files a/main/main/__pycache__/settings.cpython-312.pyc and b/main/main/__pycache__/settings.cpython-312.pyc differ diff --git a/main/main/settings.py b/main/main/settings.py index 9d9c99cde21c82235032f38b160b30d800a1030f..c343e76e68a84bbc283b3f7806c559226eda8d48 100644 --- a/main/main/settings.py +++ b/main/main/settings.py @@ -16,11 +16,11 @@ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -sys.path.append('/src/') +sys.path.append('.') STATIC_ROOT = os.path.join("static_root") MEDIA_URL = '/media/' -MEDIA_ROOT = os.path.join('/src/media') +MEDIA_ROOT = os.path.join('media') # Quick-start development settings - unsuitable for production @@ -32,7 +32,7 @@ SECRET_KEY = 'django-insecure-72ga@80_fve=s&97y(m-+68w$)$lt-@$r20eq&h6tm6w-o)&$@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ['*', '0.0.0.0', 'localhost'] +ALLOWED_HOSTS = ['*'] # Application definition @@ -66,7 +66,7 @@ ROOT_URLCONF = 'main.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [os.path.join('/src/templates'),], + 'DIRS': [os.path.join('templates'),], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -144,7 +144,7 @@ STATIC_URL = '/static/' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' -STATIC_ROOT = os.path.join('/src/static') +STATIC_ROOT = os.path.join('static') SASS_PROCESSOR_ROOT=STATIC_ROOT STATICFILES_FINDERS=[ 'django.contrib.staticfiles.finders.FileSystemFinder', diff --git a/post/Dockerfile b/post/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fa811c8ebc8732a80543b7ddf8341fa1df4ec97b --- /dev/null +++ b/post/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3 +LABEL maintainer = "COM3014-Team3" +WORKDIR /com3014-team3 +ENV PYTHONBUFFERED=1 +COPY requirements.txt ./ +COPY static ./ +COPY templates ./ +COPY media ./ +RUN pip install -r requirements.txt +COPY post ./ \ No newline at end of file diff --git a/post/post/__pycache__/settings.cpython-312.pyc b/post/post/__pycache__/settings.cpython-312.pyc index 16d80e622bfa98cf2585b0e53f909d11aff37096..00db9c0b7954b60bb8e5ee2d2a1563ea45b6736e 100644 Binary files a/post/post/__pycache__/settings.cpython-312.pyc and b/post/post/__pycache__/settings.cpython-312.pyc differ diff --git a/post/post/settings.py b/post/post/settings.py index 70687a0fce4d5c59befa2c916df5f9aeb212d907..fca2fc80491aa80f0293934d277f6a873e88b501 100644 --- a/post/post/settings.py +++ b/post/post/settings.py @@ -16,11 +16,11 @@ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -sys.path.append('/src/') +sys.path.append('.') STATIC_ROOT = os.path.join("static_root") MEDIA_URL = '/media/' -MEDIA_ROOT = os.path.join('/src/media') +MEDIA_ROOT = os.path.join('media') # Quick-start development settings - unsuitable for production @@ -32,7 +32,7 @@ SECRET_KEY = 'django-insecure-72ga@80_fve=s&97y(m-+68w$)$lt-@$r20eq&h6tm6w-o)&$@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ['*', '0.0.0.0', 'localhost'] +ALLOWED_HOSTS = ['*'] # Application definition @@ -68,7 +68,7 @@ ROOT_URLCONF = 'post.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [os.path.join('/src/templates'),], + 'DIRS': [os.path.join('templates'),], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -146,7 +146,7 @@ STATIC_URL = '/static/' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' -STATIC_ROOT = os.path.join('/src/static') +STATIC_ROOT = os.path.join('static') SASS_PROCESSOR_ROOT=STATIC_ROOT STATICFILES_FINDERS=[ 'django.contrib.staticfiles.finders.FileSystemFinder', diff --git a/profiles/Dockerfile b/profiles/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..22566ce6a6a84a7a05573ce7ac623553cbbab78d --- /dev/null +++ b/profiles/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3 +LABEL maintainer = "COM3014-Team3" +WORKDIR /com3014-team3 +ENV PYTHONBUFFERED=1 +COPY requirements.txt ./ +COPY static ./ +COPY templates ./ +COPY media ./ +RUN pip install -r requirements.txt +COPY profiles ./ \ No newline at end of file diff --git a/profiles/profiles/__pycache__/settings.cpython-312.pyc b/profiles/profiles/__pycache__/settings.cpython-312.pyc index 9cca8bf8d4aae59af749c65c7b250ff757bb8a87..de3b97214fc8b2e1cafb9d9306b0e8d39ddcae50 100644 Binary files a/profiles/profiles/__pycache__/settings.cpython-312.pyc and b/profiles/profiles/__pycache__/settings.cpython-312.pyc differ diff --git a/profiles/profiles/settings.py b/profiles/profiles/settings.py index 0ff8c6466cf587187c084fad6c2e340e6356cb6e..6bee6f782b97346e6aea60c49c5dd1724902faa0 100644 --- a/profiles/profiles/settings.py +++ b/profiles/profiles/settings.py @@ -16,11 +16,11 @@ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -sys.path.append('/src/') +sys.path.append('.') STATIC_ROOT = os.path.join("static_root") MEDIA_URL = '/media/' -MEDIA_ROOT = os.path.join('/src/media') +MEDIA_ROOT = os.path.join('media') # Quick-start development settings - unsuitable for production @@ -32,7 +32,7 @@ SECRET_KEY = 'django-insecure-72ga@80_fve=s&97y(m-+68w$)$lt-@$r20eq&h6tm6w-o)&$@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ['*', '0.0.0.0', 'localhost'] +ALLOWED_HOSTS = ['*'] # Application definition @@ -66,7 +66,7 @@ ROOT_URLCONF = 'profiles.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [os.path.join('/src/templates'),], + 'DIRS': [os.path.join('templates'),], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -144,7 +144,7 @@ STATIC_URL = '/static/' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' -STATIC_ROOT = os.path.join('/src/static') +STATIC_ROOT = os.path.join('static') SASS_PROCESSOR_ROOT=STATIC_ROOT STATICFILES_FINDERS=[ 'django.contrib.staticfiles.finders.FileSystemFinder', diff --git a/register/Dockerfile b/register/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8571fb2d85c103ab091588fe3152ab54921a4b57 --- /dev/null +++ b/register/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3 +LABEL maintainer = "COM3014-Team3" +WORKDIR /com3014-team3 +ENV PYTHONBUFFERED=1 +COPY requirements.txt ./ +COPY static ./ +COPY templates ./ +COPY media ./ +RUN pip install -r requirements.txt +COPY register ./ \ No newline at end of file diff --git a/register/register/__pycache__/__init__.cpython-310.pyc b/register/register/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6feaf4a0a01b735724edd71b30f70e76776f5dfc Binary files /dev/null and b/register/register/__pycache__/__init__.cpython-310.pyc differ diff --git a/register/register/__pycache__/settings.cpython-310.pyc b/register/register/__pycache__/settings.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6d77d67fd97a3dc5c885ff9ab443581036dbd344 Binary files /dev/null and b/register/register/__pycache__/settings.cpython-310.pyc differ diff --git a/register/register/__pycache__/settings.cpython-312.pyc b/register/register/__pycache__/settings.cpython-312.pyc index c396ce197d2a0c7802cc66be91ba229c374450ce..4b03e88484b9239199e24fcd2c8f217d49ef0aa9 100644 Binary files a/register/register/__pycache__/settings.cpython-312.pyc and b/register/register/__pycache__/settings.cpython-312.pyc differ diff --git a/register/register/__pycache__/urls.cpython-310.pyc b/register/register/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..576e8127e60ce43947157a43717ec3ae5f8a7135 Binary files /dev/null and b/register/register/__pycache__/urls.cpython-310.pyc differ diff --git a/register/register/__pycache__/wsgi.cpython-310.pyc b/register/register/__pycache__/wsgi.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..89738dc585f685e7e5db3113ebfba249ad5164ad Binary files /dev/null and b/register/register/__pycache__/wsgi.cpython-310.pyc differ diff --git a/register/register/settings.py b/register/register/settings.py index cd481da5e9247d1aaac9b2f222c6db6c955fc945..9da6371eadfb846320025d48d9aa24eb421556b3 100644 --- a/register/register/settings.py +++ b/register/register/settings.py @@ -16,11 +16,11 @@ from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -sys.path.append('/src/') -STATIC_ROOT = os.path.join("static_root") +sys.path.append('.') + MEDIA_URL = '/media/' -MEDIA_ROOT = os.path.join('/src/media') +MEDIA_ROOT = os.path.join('media') # Quick-start development settings - unsuitable for production @@ -32,7 +32,7 @@ SECRET_KEY = 'django-insecure-72ga@80_fve=s&97y(m-+68w$)$lt-@$r20eq&h6tm6w-o)&$@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ['*', '0.0.0.0', 'localhost'] +ALLOWED_HOSTS = ['*'] # Application definition @@ -64,7 +64,7 @@ ROOT_URLCONF = 'register.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [os.path.join('/src/templates'),], + 'DIRS': [os.path.join('templates'),], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -85,12 +85,12 @@ WSGI_APPLICATION = 'register.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.postgresql', + 'ENGINE':'django.db.backends.postgresql', 'NAME':'postgres', 'USER':'postgres', 'PASSWORD':'postgres', 'HOST':'pgdb', - 'PORT':'5432', + 'PORT':5432, } } @@ -142,7 +142,7 @@ STATIC_URL = '/static/' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' -STATIC_ROOT = os.path.join('src/static') +STATIC_ROOT = os.path.join('static') SASS_PROCESSOR_ROOT=STATIC_ROOT STATICFILES_FINDERS=[ 'django.contrib.staticfiles.finders.FileSystemFinder', diff --git a/register/registerapp/__pycache__/__init__.cpython-310.pyc b/register/registerapp/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f6a6e823605fd81ef0eec3919171a3da69ea7400 Binary files /dev/null and b/register/registerapp/__pycache__/__init__.cpython-310.pyc differ diff --git a/register/registerapp/__pycache__/admin.cpython-310.pyc b/register/registerapp/__pycache__/admin.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68e18a2d524b223498912b66f9967b2355c40b06 Binary files /dev/null and b/register/registerapp/__pycache__/admin.cpython-310.pyc differ diff --git a/register/registerapp/__pycache__/apps.cpython-310.pyc b/register/registerapp/__pycache__/apps.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa1513e1b494ff4bf53a44051ebb096a97582d33 Binary files /dev/null and b/register/registerapp/__pycache__/apps.cpython-310.pyc differ diff --git a/register/registerapp/__pycache__/forms.cpython-310.pyc b/register/registerapp/__pycache__/forms.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a74db27c9397d747451b5093dcadb569f38af75e Binary files /dev/null and b/register/registerapp/__pycache__/forms.cpython-310.pyc differ diff --git a/register/registerapp/__pycache__/models.cpython-310.pyc b/register/registerapp/__pycache__/models.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..65d445651a281ce2d14b123cae710a40722fd246 Binary files /dev/null and b/register/registerapp/__pycache__/models.cpython-310.pyc differ diff --git a/register/registerapp/__pycache__/urls.cpython-310.pyc b/register/registerapp/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d9b0c602dc8b74a73ca2cdbd4420135b8796868d Binary files /dev/null and b/register/registerapp/__pycache__/urls.cpython-310.pyc differ diff --git a/register/registerapp/__pycache__/views.cpython-310.pyc b/register/registerapp/__pycache__/views.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e29b71c4741a5671e980dc484de69397d3420a7 Binary files /dev/null and b/register/registerapp/__pycache__/views.cpython-310.pyc differ diff --git a/register/registerapp/migrations/__pycache__/0001_initial.cpython-310.pyc b/register/registerapp/migrations/__pycache__/0001_initial.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..247c77dd2e95f1cb484e2fab7b450045b882a612 Binary files /dev/null and b/register/registerapp/migrations/__pycache__/0001_initial.cpython-310.pyc differ diff --git a/register/registerapp/migrations/__pycache__/__init__.cpython-310.pyc b/register/registerapp/migrations/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44c34c042dfc9432f64727cdc997f13a71756b3f Binary files /dev/null and b/register/registerapp/migrations/__pycache__/__init__.cpython-310.pyc differ diff --git a/requirements.txt b/requirements.txt index 8d1582e9630db323b54dc65536bff119df1eaf7f..a4517c4b2da5005689c02a71420a756f4e386dc5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ Django>=3.0, <4.0 psycopg2-binary>=2.8 -libsass + django-sass-processor -Pillow==10.1.0 \ No newline at end of file +Pillow==10.1.0 +gunicorn \ No newline at end of file diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..1c0c1c5b9fb6979160b7115f9ad28b85ee55d441 Binary files /dev/null and b/static/favicon.ico differ diff --git a/templates/base.html b/templates/base.html index e830139b4fe95b0cb68bf79db64317cf0796d775..9eda9ec0bedeeae6f937f512d8fe0d9e1d2475fd 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,6 +4,7 @@ <!DOCTYPE html> <html lang="en"> <head> + <link rel="icon" href="/static/favicon.ico"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="{% sass_src 'css/base.scss' %}"> @@ -12,7 +13,7 @@ function confirmLogoff() { var confirmation = confirm("Are you sure you want to log out?"); if (confirmation) { - window.location.href = "http://localhost:8001"; // Redirect to home after logoff + window.location.href = "http://localhost:8000"; // Redirect to home after logoff } } </script> @@ -24,12 +25,12 @@ <div class="username">{{ username }}</div> </div> <div class="navbar-right"> - <a href="http://localhost:8001/register/welcome">Home</a> + <a href="http://localhost:8000/register/welcome">Home</a> <a href="http://localhost:8002/post/feed">Feed</a> <a href="http://localhost:8002/post/newPost">Add Photos</a> <a href="http://localhost:8003/profile">Profile</a> - <a href="http://localhost:8000/contact">Contact</a> - <a href="http://localhost:8000/about">About Us</a> + <a href="http://localhost:8001/contact">Contact</a> + <a href="http://localhost:8001/about">About Us</a> <a href="#" onclick="confirmLogoff()">Log Off</a> </div> </div>