diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..edc2751a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# The first instruction is what image we want to base our container on +# We Use an official Python runtime as a parent image +FROM python:3.9 + +# The enviroment variable ensures that the python output is set straight +# to the terminal with out buffering it first +ENV PYTHONUNBUFFERED 1 + +# create root directory for our project in the container +RUN mkdir /oacct_checker + +# Set the working directory to /OACCT_checker +WORKDIR /oacct_checker + +# Copy the current directory contents into the container at /OACCT_checker +ADD . /oacct_checker/ + +# Install any needed packages specified in requirements.txt +RUN pip install -r requirements.txt diff --git a/db.sqlite3 b/db.sqlite3 index cdaa887d..b3189adb 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/django_api/__pycache__/serializers.cpython-39.pyc b/django_api/__pycache__/serializers.cpython-39.pyc index bd08297d..bafa3a51 100644 Binary files a/django_api/__pycache__/serializers.cpython-39.pyc and b/django_api/__pycache__/serializers.cpython-39.pyc differ diff --git a/django_app/__pycache__/settings.cpython-39.pyc b/django_app/__pycache__/settings.cpython-39.pyc index c02fce1b..da81b789 100644 Binary files a/django_app/__pycache__/settings.cpython-39.pyc and b/django_app/__pycache__/settings.cpython-39.pyc differ diff --git a/django_app/settings.py b/django_app/settings.py index 33c0a302..2b0e21ca 100644 --- a/django_app/settings.py +++ b/django_app/settings.py @@ -1,133 +1,133 @@ """ Django settings for django_api project. Generated by 'django-admin startproject' using Django 3.1.3. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ import os # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'v*+0qo%#emd(a4)0up06u9(s)#sm@dcer7ho@w595wj&f%&zb4' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['0.0.0.0'] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_api', 'corsheaders', 'rest_framework', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'django_app.urls' CORS_ORIGIN_ALLOW_ALL = False TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'django_app.wsgi.application' # Database # https://docs.djangoproject.com/en/3.1/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/3.1/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.1/howto/static-files/ STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static'), ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..ecda7d2e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3.9" + +services: + db: + image: postgres + environment: + - POSTGRES_DB=postgres + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + web: + build: . + command: python manage.py runserver 0.0.0.0:8000 + volumes: + - .:/oacct_checker + ports: + - "8000:8000" + depends_on: + - db \ No newline at end of file