Files
dj52/Dockerfile
Beyhan Oğur ec28a2024d first commit
2026-04-26 22:22:29 +03:00

42 lines
1.1 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Python 3.14.2 base image kullan
FROM python:3.14.2-slim
# Çalışma ortamı değişkenlerini ayarla
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
# Çalışma dizinini oluştur
WORKDIR /app
# Sistem bağımlılıklarını yükle (PostgreSQL ve diğer gerekli paketler için)
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
postgresql-client \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Python bağımlılıklarını kopyala ve yükle
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Proje dosyalarını kopyala
COPY . .
# Static dosyaları topla
RUN python manage.py collectstatic --noinput --clear || true
# Media ve staticfiles dizinlerini oluştur
RUN mkdir -p /app/media /app/staticfiles
# Port 8000'i aç
EXPOSE 8000
# Entrypoint scriptini çalıştırılabilir yap
RUN chmod +x /app/entrypoint.sh || true
# Entrypoint ve varsayılan komut
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["gunicorn", "core.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "3"]