fix: Add proxy configuration in Dockerfile and remove hardcoded environment variables
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -4,6 +4,7 @@ FROM python:3.10-slim AS builder
|
|||||||
# Install build-time packages and Python dependencies in one layer
|
# Install build-time packages and Python dependencies in one layer
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY requirements.txt /app/requirements.txt
|
COPY requirements.txt /app/requirements.txt
|
||||||
|
RUN echo 'Acquire::http::Proxy "http://192.168.88.14:3142";' > /etc/apt/apt.conf.d/90proxy
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends build-essential gcc libpq-dev \
|
&& apt-get install -y --no-install-recommends build-essential gcc libpq-dev \
|
||||||
&& python -m pip install --upgrade pip \
|
&& python -m pip install --upgrade pip \
|
||||||
@@ -18,15 +19,7 @@ WORKDIR /app
|
|||||||
COPY --from=builder /install /usr/local
|
COPY --from=builder /install /usr/local
|
||||||
|
|
||||||
# Production environment variables
|
# Production environment variables
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
COPY .env /app/.env
|
||||||
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 application code
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|||||||
Reference in New Issue
Block a user