Fix os import and add media settings 4

This commit is contained in:
ack
2026-01-21 04:30:54 +03:00
parent e57a05ccf5
commit 0f5455618b
2 changed files with 20 additions and 2 deletions

View File

@@ -18,5 +18,14 @@ RUN pip install --no-cache-dir -r requirements.txt
# Копируем весь проект в контейнер
COPY . .
# Команда для запуска (пока простая)
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
# ... (твои предыдущие шаги: FROM, WORKDIR, COPY) ...
# Копируем скрипт и даем ему права на выполнение
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Указываем скрипт как точку входа
ENTRYPOINT ["/entrypoint.sh"]
# Команда по умолчанию (которую подхватит exec "$@" в скрипте)
CMD ["gunicorn", "core.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "3"]

9
entrypoint.sh Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
# Собираем статику
echo "Collecting static files..."
python manage.py collectstatic --noinput
# Запускаем основную команду (Gunicorn)
echo "Starting Gunicorn..."
exec "$@"