Compare commits

...

2 Commits

Author SHA1 Message Date
jeremygan2021
0fa0fc615d debug
All checks were successful
Deploy to Server / deploy (push) Successful in 16s
2026-02-24 16:12:54 +08:00
jeremygan2021
9dff3c074d 活动倒计时 2026-02-24 16:12:06 +08:00
2 changed files with 16 additions and 16 deletions

View File

@@ -101,19 +101,7 @@ DATABASES = {
#从环境变量获取数据库配置 (Docker 环境会自动注入这些变量。
# DB_HOST = os.environ.get('DB_HOST', '6.6.6.66')
# if DB_HOST:
# DATABASES['default'] = {
# 'ENGINE': 'django.db.backends.postgresql',
# 'NAME': os.environ.get('DB_NAME', 'market'),
# 'USER': os.environ.get('DB_USER', 'market'),
# 'PASSWORD': os.environ.get('DB_PASSWORD', '123market'),
# 'HOST': DB_HOST,
# 'PORT': os.environ.get('DB_PORT', '5432'),
# }
DB_HOST = os.environ.get('DB_HOST', '121.43.104.161')
DB_HOST = os.environ.get('DB_HOST', '6.6.6.66')
if DB_HOST:
DATABASES['default'] = {
'ENGINE': 'django.db.backends.postgresql',
@@ -121,10 +109,22 @@ if DB_HOST:
'USER': os.environ.get('DB_USER', 'market'),
'PASSWORD': os.environ.get('DB_PASSWORD', '123market'),
'HOST': DB_HOST,
'PORT': os.environ.get('DB_PORT', '6433'),
'PORT': os.environ.get('DB_PORT', '5432'),
}
# DB_HOST = os.environ.get('DB_HOST', '121.43.104.161')
# if DB_HOST:
# DATABASES['default'] = {
# 'ENGINE': 'django.db.backends.postgresql',
# 'NAME': os.environ.get('DB_NAME', 'market'),
# 'USER': os.environ.get('DB_USER', 'market'),
# 'PASSWORD': os.environ.get('DB_PASSWORD', '123market'),
# 'HOST': DB_HOST,
# 'PORT': os.environ.get('DB_PORT', '6433'),
# }
# Password validation
# https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators

View File

@@ -1,7 +1,7 @@
services:
backend:
build: ./backend
# 使用 gunicorn 替代 runserver提高稳定性并捕获标准输出
# 使用 gunicorn 替代 runserver提高稳定性并捕获标准输出1
command: sh -c "python manage.py collectstatic --noinput && python manage.py migrate && gunicorn --bind 0.0.0.0:8000 --access-logfile - --error-logfile - config.wsgi:application"
volumes:
- ./backend:/app
@@ -11,7 +11,7 @@ services:
- DB_NAME=market
- DB_USER=market
- DB_PASSWORD=123market
- DB_HOST=localhost
- DB_HOST=6.6.6.66
- DB_PORT=5432
frontend: