perf: remove source code volume mount, collectstatic at build time
All checks were successful
Deploy to Server / deploy (push) Successful in 1m58s
All checks were successful
Deploy to Server / deploy (push) Successful in 1m58s
This commit is contained in:
@@ -16,6 +16,9 @@ RUN pip install --upgrade pip && pip install -r requirements.txt
|
||||
COPY . /app/
|
||||
COPY .env /app/
|
||||
|
||||
# 收集静态文件(build 时执行,避免每次启动都跑)
|
||||
RUN python manage.py collectstatic --noinput || true
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 8876
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ services:
|
||||
backend:
|
||||
build: ./backend
|
||||
container_name: cywl-scoring-backend
|
||||
command: sh -c "python manage.py collectstatic --noinput && python manage.py migrate && gunicorn --bind 0.0.0.0:8876 --workers 4 --timeout 120 --access-logfile - --error-logfile - config.wsgi:application"
|
||||
command: sh -c "python manage.py migrate && gunicorn --bind 0.0.0.0:8876 --workers 4 --timeout 120 --access-logfile - --error-logfile - config.wsgi:application"
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
- ./backend/media:/app/media
|
||||
- ./backend/.env:/app/.env
|
||||
ports:
|
||||
- "8876:8876"
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user