Update deployment related files

This commit is contained in:
Keannu Bernasol 2023-12-03 00:43:50 +08:00
parent ad295a0e6d
commit fefc3aae38
14 changed files with 72 additions and 1373 deletions

View file

@ -15,7 +15,7 @@ WORKDIR /code
ADD . /code/
# Install pipenv
RUN pip install --no-cache-dir -r linux-requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Make migrations
RUN python equipment_tracker/manage.py makemigrations
@ -24,7 +24,7 @@ RUN python equipment_tracker/manage.py makemigrations
RUN python equipment_tracker/manage.py migrate
# Generate DRF Spectacular Documentation
RUN python equipment_tracker/manage.py spectacular --color --file stude/schema.yml
RUN python equipment_tracker/manage.py spectacular --color --file equipment_tracker/schema.yml
# Expose port 8000 for the web server
EXPOSE 8000

View file

@ -15,7 +15,7 @@ services:
[
"sh",
"-c",
"python equipment_tracker/manage.py spectacular --color --file stude/schema.yml && python equipment_tracker/manage.py collectstatic --noinput && python equipment_tracker/manage.py makemigrations && python equipment_tracker/manage.py migrate && python equipment_tracker/manage.py runserver",
"python equipment_tracker/manage.py spectacular --color --file equipment_tracker/schema.yml && python equipment_tracker/manage.py collectstatic --noinput && python equipment_tracker/manage.py makemigrations && python equipment_tracker/manage.py migrate && python equipment_tracker/manage.py runserver",
]
volumes:
- .:/code # For hotreloading

View file

@ -28,10 +28,11 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = str(os.getenv('SECRET_KEY'))
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
ALLOWED_HOSTS = ['*']
# CSRF_TRUSTED_ORIGINS = [] To-do: Specify URL to web frontend
CSRF_TRUSTED_ORIGINS = [
"https://equipment-tracker-frontend.keannu1.duckdns.org"]
# Email credentials
EMAIL_HOST = ''
@ -210,7 +211,7 @@ USE_TZ = True
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
DOMAIN = 'citc-tracker.keannu1.duckdns.org'
DOMAIN = 'equipment-tracker-frontend.keannu1.duckdns.org'
SITE_NAME = 'CITC Equipment Tracker'

View file

@ -933,6 +933,22 @@ components:
required:
- token
- uid
CategoryEnum:
enum:
- PC
- NETWORKING
- CCTV
- FURNITURE
- PERIPHERALS
- MISC
type: string
description: |-
* `PC` - PC
* `NETWORKING` - Networking
* `CCTV` - CCTV
* `FURNITURE` - Furniture
* `PERIPHERALS` - Peripherals
* `MISC` - Miscellaneous
CustomUser:
type: object
properties:
@ -970,6 +986,8 @@ components:
type: string
description:
type: string
category:
$ref: '#/components/schemas/CategoryEnum'
last_updated:
type: string
format: date-time
@ -996,6 +1014,12 @@ components:
readOnly: true
equipment:
type: integer
equipment_name:
type: string
readOnly: true
category:
type: string
readOnly: true
status:
$ref: '#/components/schemas/StatusEnum'
remarks:
@ -1012,12 +1036,13 @@ components:
format: date-time
readOnly: true
required:
- category
- date_added
- equipment
- equipment_name
- id
- last_updated
- last_updated_by
- remarks
- status
EquipmentInstanceLog:
type: object
@ -1027,6 +1052,12 @@ components:
readOnly: true
equipment:
type: integer
equipment_name:
type: string
readOnly: true
category:
type: string
readOnly: true
status:
type: string
remarks:
@ -1048,8 +1079,10 @@ components:
type: object
additionalProperties: {}
required:
- category
- date_added
- equipment
- equipment_name
- history
- id
- last_updated
@ -1067,6 +1100,12 @@ components:
readOnly: true
equipment:
type: integer
equipment_name:
type: string
readOnly: true
category:
type: string
readOnly: true
status:
allOf:
- $ref: '#/components/schemas/StatusEnum'
@ -1074,6 +1113,7 @@ components:
remarks:
type: string
readOnly: true
nullable: true
history_date:
type: string
format: date-time
@ -1082,7 +1122,9 @@ components:
type: string
readOnly: true
required:
- category
- equipment
- equipment_name
- history_date
- history_id
- history_user
@ -1099,6 +1141,8 @@ components:
type: string
description:
type: string
category:
$ref: '#/components/schemas/CategoryEnum'
last_updated:
type: string
format: date-time
@ -1117,7 +1161,6 @@ components:
additionalProperties: {}
required:
- date_added
- description
- history
- id
- last_updated
@ -1135,6 +1178,9 @@ components:
description:
type: string
readOnly: true
nullable: true
category:
$ref: '#/components/schemas/CategoryEnum'
history_date:
type: string
format: date-time
@ -1193,6 +1239,8 @@ components:
type: string
description:
type: string
category:
$ref: '#/components/schemas/CategoryEnum'
last_updated:
type: string
format: date-time
@ -1212,6 +1260,12 @@ components:
readOnly: true
equipment:
type: integer
equipment_name:
type: string
readOnly: true
category:
type: string
readOnly: true
status:
$ref: '#/components/schemas/StatusEnum'
remarks:
@ -1262,13 +1316,16 @@ components:
- new_username
StatusEnum:
enum:
- Working
- Broken
- Under Maintenance
- Decomissioned
- WORKING
- BROKEN
- MAINTENANCE
- DECOMISSIONED
type: string
description: "* `Working` - Working\n* `Broken` - Broken\n* `Under Maintenance`\
\ - Under Maintenance\n* `Decomissioned` - Decomissioned "
description: |-
* `WORKING` - Working
* `BROKEN` - Broken
* `MAINTENANCE` - Under Maintenance
* `DECOMISSIONED` - Decomissioned
TokenObtainPair:
type: object
properties:

File diff suppressed because it is too large Load diff