feat: Refactor database configuration to use granular environment variables; update Docker and CI/CD workflows accordingly
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6s
Deploy to Server / deploy (push) Failing after 2s

This commit is contained in:
2025-10-23 19:17:24 +02:00
parent 8c3062fd80
commit 8dedfb8f26
15 changed files with 219 additions and 64 deletions

View File

@@ -5,11 +5,11 @@ FROM python:3.10-slim AS builder
WORKDIR /app
COPY requirements.txt /app/requirements.txt
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential gcc libpq-dev \
&& python -m pip install --upgrade pip \
&& pip install --no-cache-dir --prefix=/install -r /app/requirements.txt \
&& apt-get purge -y --auto-remove build-essential gcc \
&& rm -rf /var/lib/apt/lists/*
&& apt-get install -y --no-install-recommends build-essential gcc libpq-dev \
&& python -m pip install --upgrade pip \
&& pip install --no-cache-dir --prefix=/install -r /app/requirements.txt \
&& apt-get purge -y --auto-remove build-essential gcc \
&& rm -rf /var/lib/apt/lists/*
FROM python:3.10-slim
WORKDIR /app
@@ -19,7 +19,14 @@ COPY --from=builder /install /usr/local
# Production environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
PYTHONUNBUFFERED=1 \
DATABASE_DRIVER=postgresql \
DATABASE_HOST=localhost \
DATABASE_PORT=5432 \
DATABASE_USER=calminer \
DATABASE_PASSWORD=changeme \
DATABASE_NAME=calminer \
DATABASE_SCHEMA=public
# Copy application code
COPY . /app