improved compose and entry point files
This commit is contained in:
@@ -31,6 +31,7 @@ ALLOWED_HOSTS = ['*']
|
||||
# Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.
|
||||
SESSION_COOKIE_SECURE = True
|
||||
CSRF_COOKIE_SECURE = True
|
||||
CSRF_TRUSTED_ORIGINS = ["http://localhost:8000", "http://127.0.0.1:8000", "http://10.0.2.249:8000", "https://*.etss.it"]
|
||||
|
||||
# Application definition
|
||||
INSTALLED_APPS = [
|
||||
|
||||
@@ -7,29 +7,43 @@ services:
|
||||
# set shared memory limit when using docker-compose
|
||||
shm_size: 128mb
|
||||
volumes:
|
||||
- /mnt/data/postgresql:/var/lib/postgresql/data
|
||||
- postgresql_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- 5432:5432
|
||||
networks:
|
||||
- cntnet
|
||||
environment:
|
||||
POSTGRES_USER: tech
|
||||
POSTGRES_PASSWORD: tech
|
||||
POSTGRED_DB: techstorage
|
||||
POSTGRES_DB: flightslot_db
|
||||
POSTGRES_USER: flightslot
|
||||
POSTGRES_PASSWORD: flightslot
|
||||
PGDATA: /var/lib/postgresql/data
|
||||
|
||||
flightslot:
|
||||
image: flightslot:dev
|
||||
image: flightslot:latest
|
||||
container_name: tech-flightslot
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 8000:8000
|
||||
networks:
|
||||
- cntnet
|
||||
depends_on:
|
||||
- postgresql
|
||||
environment:
|
||||
- DJANGO_SETTINGS_MODULE=cntmanage.settings_prod
|
||||
- DJANGO_SUPERUSER_USERNAME=admin
|
||||
- DJANGO_SUPERUSER_EMAIL=emanuele.trabattoni@gmail.com
|
||||
- DJANGO_SUPERUSER_PASSWORD=CantorAir2k25
|
||||
- SECRET_KEY=6WIjA!+mI+ZOWHaJm6v^8F4o,@-gliDtwkp*QFvpkFe"Oo0quq
|
||||
- DB_NAME=techstorage
|
||||
- DB_USER=tech
|
||||
- DB_PASSWORD=tech
|
||||
- DB_NAME=flightslot_db
|
||||
- DB_USER=flightslot
|
||||
- DB_PASSWORD=flightslot
|
||||
- DB_HOST=postgresql
|
||||
- DB_PORT=5432
|
||||
|
||||
volumes:
|
||||
postgresql_data:
|
||||
name: postgress_data
|
||||
|
||||
networks:
|
||||
cntnet:
|
||||
|
||||
@@ -16,5 +16,12 @@ cp -v /app/static/* /var/www/static/
|
||||
echo "📁 Manually copying template files..."
|
||||
cp -rv /app/templates/ /var/www/templates/
|
||||
|
||||
echo "👁️ Creating superuser..."
|
||||
if django-admin createsuperuser --noinput --email ${DJANGO_SUPERUSER_EMAIL} --username ${DJANGO_SUPERUSER_USERNAME}; then
|
||||
echo "👁️ Superuser ${DJANGO_SUPERUSER_USERNAME} already created ..."
|
||||
else
|
||||
echo "👁️ Superuser ${DJANGO_SUPERUSER_USERNAME} created successfully ..."
|
||||
fi
|
||||
|
||||
echo "🚀 Launching Flightslot..."
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user