chore: implement self-healing entrypoint and fix line endings
Build & Push Docker Image (Backend) / build (push) Successful in 2m8s

This commit is contained in:
Flook
2026-04-28 20:12:16 +07:00
parent 8a6c626f89
commit de7531e911
2 changed files with 45 additions and 8 deletions
+9 -8
View File
@@ -35,19 +35,20 @@ RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# =========================
# Collect Static Files
# Setup Entrypoint (เพิ่มตรงนี้ครับ)
# =========================
RUN python manage.py collectstatic --noinput
# แนะนำให้ใช้คำสั่งนี้เพื่อให้มั่นใจว่าสิทธิ์ไฟล์ถูกต้องใน Linux environment
RUN chmod +x /app/entrypoint.sh
# =========================
# Expose Application Port
# Environment Variables (Optional)
# =========================
EXPOSE 8000
# =========================
# Run Application
# ENTRYPOINT & CMD # ENTRYPOINT จะรันสคริปต์เพื่อ Migrate ฐานข้อมูลก่อนเสมอ
# =========================
# =========================
# Run Application
# =========================
CMD ["python", "-m", "gunicorn", "core.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "3", "--timeout", "120"]
ENTRYPOINT ["/app/entrypoint.sh"]
# CMD จะถูกส่งไปเป็นพารามิเตอร์ $1 ให้กับ entrypoint.sh
CMD ["gunicorn"]