mirror of
https://github.com/Fluffy-Bean/Fluffys-website.git
synced 2024-12-26 17:26:06 +00:00
💀
This commit is contained in:
parent
7617e19e66
commit
4394e713bd
|
@ -5,18 +5,28 @@ services:
|
|||
image: postgres:alpine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./postgres/data:/var/lib/postgresql/data
|
||||
- ./data/postgres:/var/lib/postgresql/data
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
|
||||
# proxy:
|
||||
# image: caddy:alpine
|
||||
# restart: unless-stopped
|
||||
# ports:
|
||||
# - "80:80"
|
||||
# volumes:
|
||||
# - ./data/caddy/Caddyfile:/etc/caddy/Caddyfile
|
||||
# - ./data/static:/website/static
|
||||
# - ./data/media:/website/media
|
||||
|
||||
website:
|
||||
build: website
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./data/media:/website/media
|
||||
- ./data/static:/app/static
|
||||
- ./data/media:/app/media
|
||||
environment:
|
||||
DJANGO_KEY: ${DJANGO_KEY}
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
|
@ -25,4 +35,5 @@ services:
|
|||
depends_on:
|
||||
- db
|
||||
ports:
|
||||
- "6212:8000"
|
||||
- "8000:8000"
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ WORKDIR /app
|
|||
COPY requirements.txt requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
COPY website .
|
||||
COPY ./website/ /app/
|
||||
COPY run.sh run.sh
|
||||
RUN chmod +x run.sh
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Wait for database to start
|
||||
until pg_isready -d $POSTGRES_DB -h db -U $POSTGRES_USER
|
||||
do
|
||||
echo "Waiting for database to start... (5s)"
|
||||
|
@ -9,8 +8,6 @@ done
|
|||
|
||||
echo "Database is ready!"
|
||||
|
||||
# Check if there are any changes to the database
|
||||
#python3 manage.py showmigrations
|
||||
if (python3 manage.py showmigrations | grep "\[ \]" > /dev/null);
|
||||
then
|
||||
echo "Database changes detected! Migrating..."
|
||||
|
@ -18,7 +15,9 @@ then
|
|||
python3 manage.py migrate
|
||||
fi
|
||||
|
||||
# Start server!!!!
|
||||
# echo "Collecting static files..."
|
||||
# python3 manage.py collectstatic --noinput
|
||||
|
||||
echo "Starting server..."
|
||||
gunicorn --bind :8000 website.wsgi:application
|
||||
|
||||
|
|
|
@ -29,6 +29,10 @@ DEBUG = True
|
|||
|
||||
ALLOWED_HOSTS = ["*"]
|
||||
|
||||
CSRF_TRUSTED_ORIGINS = [
|
||||
'https://*.leggy.dev',
|
||||
]
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
|
@ -124,7 +128,7 @@ USE_TZ = True
|
|||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
||||
|
||||
STATIC_URL = "static/"
|
||||
STATIC_URL = "static"
|
||||
STATICFILES_DIRS = (join(BASE_DIR, "static"),)
|
||||
STATICFILES_FINDERS = [
|
||||
"compressor.finders.CompressorFinder",
|
||||
|
@ -132,7 +136,7 @@ STATICFILES_FINDERS = [
|
|||
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
|
||||
]
|
||||
|
||||
MEDIA_URL = "media/"
|
||||
MEDIA_URL = "media"
|
||||
MEDIA_ROOT = join(BASE_DIR, "media")
|
||||
|
||||
COMPRESS_ROOT = join(BASE_DIR, "static/")
|
||||
|
|
Loading…
Reference in a new issue