feat: implement consumable inventory module, network LAN access, and CI/CD enhancements
- Modul Consumable Item: model master, buku besar transaksi (stock ledger), purchase unit conversion, stock opname, dan transaction reversal - Integrasi ke Employee Management, Asset Unit, dan tiket/work order - Konfigurasi akses jaringan lokal (LAN) via 0.0.0.0:8000, ALLOWED_HOSTS, dan CSRF_TRUSTED_ORIGINS otomatis - Script pembuka firewall Windows (buka_firewall_lan.bat) dan menu interaktif run.bat - Skema migrasi 0019_consumableitem_consumabletransaction - Seeder 11 item consumable riil (seed_consumables.py) - Test suite komprehensif (41 automated tests, 100% lulus) - Pipeline CI/CD GitHub Actions (.github/workflows/ci.yml)
This commit is contained in:
+51
@@ -0,0 +1,51 @@
|
||||
# ==============================================================
|
||||
# Dockerfile — Sistem Manajemen Aset IT PT. Kerinci Merangin Hidro
|
||||
# Multi-stage production build (Python 3.12-slim)
|
||||
# ==============================================================
|
||||
|
||||
FROM python:3.12-slim as base
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies for Pillow, ReportLab, and MySQL
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
default-libmysqlclient-dev \
|
||||
pkg-config \
|
||||
libjpeg-dev \
|
||||
zlib1g-dev \
|
||||
libfreetype6-dev \
|
||||
liblcms2-dev \
|
||||
libopenjp2-7-dev \
|
||||
libtiff5-dev \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python packages
|
||||
COPY requirements.txt /app/
|
||||
RUN pip install --upgrade pip && \
|
||||
pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy project code
|
||||
COPY . /app/
|
||||
|
||||
# Create non-root user for security
|
||||
RUN useradd -m -u 1000 appuser && \
|
||||
mkdir -p /app/staticfiles /app/media/bast_documents && \
|
||||
chown -R appuser:appuser /app
|
||||
|
||||
USER appuser
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD curl -f http://127.0.0.1:8000/login/ || exit 1
|
||||
|
||||
# Default command: run gunicorn WSGI server
|
||||
CMD ["gunicorn", "itam_core.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "3", "--timeout", "120"]
|
||||
Reference in New Issue
Block a user