-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 789 Bytes
/
Dockerfile
File metadata and controls
33 lines (25 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first (for Docker layer caching)
COPY core/requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY core/ /app/core/
COPY db/ /app/db/
COPY packs/ /app/packs/
COPY coprocessor/ /app/coprocessor/
COPY alembic.ini /app/
# Set Python path to include app directory
ENV PYTHONPATH=/app
# Cloud Run sets PORT environment variable
ENV PORT=8080
EXPOSE 8080
# Production command: run migrations then start server
CMD alembic upgrade head && exec uvicorn core.main:app --host 0.0.0.0 --port $PORT