Skip to content

Commit

Permalink
Merge pull request #114 from zooniverse/add-redis-pvc
Browse files Browse the repository at this point in the history
Deployment touchups
  • Loading branch information
zwolf committed Jan 25, 2021
2 parents f2acd6e + c5c6ad0 commit 906f7f1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
14 changes: 14 additions & 0 deletions kubernetes/deployment-production.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ spec:
env:
- name: PANOPTES_PROD_URL
value: https://panoptes.zooniverse.org/
- name: ENV
value: production
volumeMounts:
- name: theia-production-volume
mountPath: "/tmp"
Expand Down Expand Up @@ -114,6 +116,18 @@ spec:
claimName: theia-production-redis
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: theia-production-redis
spec:
accessModes:
- ReadWriteMany
storageClassName: azurefile
resources:
requests:
storage: 5Gi
---
apiVersion: v1
kind: Service
metadata:
name: theia-production-redis
Expand Down
2 changes: 1 addition & 1 deletion start_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ done
echo Applying migrations
python manage.py migrate --noinput

if [ "$DJANGO_ENV" == "production" ]; then
if [ "$ENV" == "production" ]; then
if [ ! -d "theia/static" ]; then
echo Generating static files
python manage.py collectstatic
Expand Down
5 changes: 4 additions & 1 deletion theia/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '6n$fr-9vudyln(o=6jzv*pr_3b9(kajv=#&wq6ep4vm_s1m@6p'
if os.environ.get('ENV') == "production":
SECRET_KEY = os.environ.get('SECRET_KEY')
else
SECRET_KEY = '6n$fr-9vudyln(o=6jzv*pr_3b9(kajv=#&wq6ep4vm_s1m@6p'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Expand Down

0 comments on commit 906f7f1

Please sign in to comment.