cleanup: docker-compose and .env.example

This commit is contained in:
Dariusz Niemczyk 2024-01-19 19:22:36 +01:00
parent 1bbd28933f
commit 5bf31f26a1
No known key found for this signature in database
5 changed files with 20 additions and 42 deletions

View File

@ -1,4 +1,4 @@
version: '3'
version: "3"
services:
# Update this to the name of the service you want to work with in your docker-compose.yml file
web:
@ -30,11 +30,10 @@ services:
- SPEJSTORE_DB_PASSWORD=postgres
- SPEJSTORE_DB_HOST=db
# - SPEJSTORE_DB_PORT=
- SPEJSTORE_ALLOWED_HOSTS=localhost,127.0.0.1
- SPEJSTORE_ALLOWED_HOSTS=localhost,127.0.0.1,0.0.0.0
# - SPEJSTORE_CLIENT_ID=
# - SPEJSTORE_SECRET=
# - SPEJSTORE_MEDIA_ROOT=
# - SPEJSTORE_REQUIRE_AUTH=true
- SPEJSTORE_OAUTH_REDIRECT_IS_HTTPS=false
- SPEJSTORE_PROXY_TRUSTED_IPS=172.21.37.1
# - SPEJSTORE_PROXY_TRUSTED_IPS=172.21.37.1

View File

@ -7,3 +7,14 @@ SPEJSTORE_DB_USER=postgres
SPEJSTORE_DB_HOST=db
SPEJSTORE_HOST="https://inventory.hackerspace.pl"
SPEJSTORE_LABEL_API=https://label.waw.hackerspace.pl
# "filesystem" or "s3"
SPEJSTORE_FILE_STORAGE_TYPE="filesystem"
# S3 bucket
SPEJSTORE_S3_ACCESS_KEY="SPEJSTORE_S3_ACCESS_KEY"
SPEJSTORE_S3_SECRET_KEY="SPEJSTORE_S3_SECRET_KEY"
SPEJSTORE_S3_ENDPOINT_URL="SPEJSTORE_S3_ENDPOINT_URL"
SPEJSTORE_S3_BUCKET_NAME="SPEJSTORE_S3_BUCKET_NAME"
SPEJSTORE_S3_MEDIA_LOCATION="SPEJSTORE_S3_MEDIA_LOCATION"

View File

@ -1,17 +0,0 @@
version: "3"
services:
web:
environment:
- SPEJSTORE_ENV=dev
- SPEJSTORE_DB_NAME=postgres
- SPEJSTORE_DB_USER=postgres
- SPEJSTORE_DB_PASSWORD=postgres
- SPEJSTORE_DB_HOST=db
# - SPEJSTORE_DB_PORT=
- SPEJSTORE_ALLOWED_HOSTS=localhost,127.0.0.1
# - SPEJSTORE_CLIENT_ID=
# - SPEJSTORE_SECRET=
# - SPEJSTORE_MEDIA_ROOT=
# - SPEJSTORE_REQUIRE_AUTH=true
- SPEJSTORE_OAUTH_REDIRECT_IS_HTTPS=false
- SPEJSTORE_PROXY_TRUSTED_IPS=172.21.37.1

View File

@ -1,8 +0,0 @@
version: "3"
services:
db:
volumes:
- /var/spejstore-data-new:/var/lib/postgresql/data
web:
build: .

View File

@ -1,15 +1,3 @@
"""
Django settings for spejstore project.
Generated by 'django-admin startproject' using Django 1.10.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
@ -171,6 +159,11 @@ SOCIAL_AUTH_PIPELINE = (
# Determines the storage type for Django static files and media.
FILE_STORAGE_TYPE = env("FILE_STORAGE_TYPE", "filesystem")
# Make sure we check for correct file storage type
if not (FILE_STORAGE_TYPE == "filesystem" or FILE_STORAGE_TYPE == "s3"):
raise Exception("SPEJSTORE_FILE_STORAGE_TYPE must be 'filesystem' or 's3' ")
if FILE_STORAGE_TYPE == "filesystem":
STORAGES = {
"default": {