Skip to content

Commit

Permalink
🐳 new platform-dev image
Browse files Browse the repository at this point in the history
  • Loading branch information
esinx committed Sep 22, 2024
1 parent a12c2fa commit 1733fa0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ docker-compose.yml

# Uploaded media files
backend/accounts/mediafiles

.env
12 changes: 3 additions & 9 deletions backend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
FROM pennlabs/django-base:b269ea1613686b1ac6370154debbb741b012de1a-3.9.14
FROM pennlabs/django-base:b269ea1613686b1ac6370154debbb741b012de1a-3.11

LABEL maintainer="Penn Labs"

# Update PGP key for NGINX
# https://blog.nginx.org/blog/updating-pgp-key-for-nginx-software
RUN wget -O/etc/apt/trusted.gpg.d/nginx.asc https://nginx.org/keys/nginx_signing.key

# Copy project dependencies
COPY Pipfile* /app/

Expand All @@ -15,10 +11,8 @@ RUN pipenv install --system
# Copy project files
COPY . /app/

ENV DJANGO_SETTINGS_MODULE Platform.settings.production
ENV DJANGO_SETTINGS_MODULE Platform.settings.staging
ENV SECRET_KEY 'temporary key just to build the docker image'
ENV IDENTITY_RSA_PRIVATE_KEY 'temporary private key just to build the docker image'
ENV OIDC_RSA_PRIVATE_KEY 'temporary private key just to build the docker image'

# Collect static files
RUN python3 /app/manage.py collectstatic --noinput
RUN python3 /app/manage.py collectstatic --noinput
48 changes: 48 additions & 0 deletions backend/Platform/settings/staging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import os

import sentry_sdk
from django.core.exceptions import ImproperlyConfigured
from sentry_sdk.integrations.django import DjangoIntegration

from Platform.settings.base import * # noqa
from Platform.settings.base import DOMAINS


DEBUG = False

# Honour the 'X-Forwarded-Proto' header for request.is_secure()
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")

# Allow production host headers
ALLOWED_HOSTS = DOMAINS

# SECRET_KEY = os.environ.get("SECRET_KEY", None)

# IDENTITY_RSA_PRIVATE_KEY = os.environ.get("IDENTITY_RSA_PRIVATE_KEY", None)

# OIDC_RSA_PRIVATE_KEY = os.environ.get("OIDC_RSA_PRIVATE_KEY", None)

# Sentry settings
SENTRY_URL = os.environ.get("SENTRY_URL", "")
sentry_sdk.init(dsn=SENTRY_URL, integrations=[DjangoIntegration()])

# CORS settings
CORS_ALLOW_ALL_ORIGINS = True
CORS_ALLOW_METHODS = ["GET", "POST"]
CORS_URLS_REGEX = r"^(/options/)|(/accounts/token/)$"

# Email client settings
EMAIL_HOST = os.getenv("SMTP_HOST")
EMAIL_PORT = int(os.getenv("SMTP_PORT", 587))
EMAIL_HOST_USER = os.getenv("SMTP_USERNAME")
EMAIL_HOST_PASSWORD = os.getenv("SMTP_PASSWORD")
EMAIL_USE_TLS = True

IS_DEV_LOGIN = os.environ.get("DEV_LOGIN", "False") in ["True", "TRUE", "true"]

# AWS S3
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID")
AWS_ACCESS_SECRET_ID = os.getenv("AWS_SECRET_ACCESS_KEY")
AWS_STORAGE_BUCKET_NAME = os.getenv("AWS_STORAGE_BUCKET_NAME")
AWS_QUERYSTRING_AUTH = False

0 comments on commit 1733fa0

Please sign in to comment.