Files
calminer/Dockerfile
zwitschi f864ad563a
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 12s
Deploy to Server / deploy (push) Failing after 3s
fix: Add proxy configuration in Dockerfile and remove hardcoded environment variables
2025-10-23 19:38:22 +02:00

32 lines
969 B
Docker

# Multi-stage Dockerfile to keep final image small
FROM python:3.10-slim AS builder
# Install build-time packages and Python dependencies in one layer
WORKDIR /app
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 \
&& 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
# Copy installed packages from builder
COPY --from=builder /install /usr/local
# Production environment variables
COPY .env /app/.env
# Copy application code
COPY . /app
# Expose service port
EXPOSE 8000
# Run the FastAPI app with uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]