refactor. pre-deploy
This commit is contained in:
26
.history/backend/Dockerfile_20251029192513
Normal file
26
.history/backend/Dockerfile_20251029192513
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Установка системных зависимостей
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
postgresql-client \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Копирование и установка requirements
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Копирование кода приложения
|
||||
COPY . .
|
||||
|
||||
# Создание директорий для статики и медиа
|
||||
RUN mkdir -p staticfiles storage
|
||||
|
||||
# Сбор статических файлов
|
||||
RUN python manage.py collectstatic --noinput --clear
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["gunicorn", "backend.wsgi:application", "--bind", "0.0.0.0:8000"]
|
||||
Reference in New Issue
Block a user