45 lines
1.3 KiB
Docker
45 lines
1.3 KiB
Docker
# Copyright 2026 Google LLC
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies & curl for healthcheck
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl \
|
|
ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Python requirements
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application source code
|
|
COPY app/ /app/app/
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV PYTHONPATH=/app
|
|
ENV PORT=8000
|
|
ENV CLOUD_ORCHESTRATOR_URL=http://cloud-orchestrator:2081
|
|
ENV CUTTLEFISH_HOST_GATEWAY=cloud-orchestrator
|
|
|
|
EXPOSE 8000
|
|
|
|
# Health check to ensure API is responsive
|
|
HEALTHCHECK --interval=15s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD curl -f http://localhost:8000/healthz || exit 1
|
|
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|