feat: Refactor database configuration to use granular environment variables; update Docker and CI/CD workflows accordingly
This commit is contained in:
19
Dockerfile
19
Dockerfile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user