File size: 933 Bytes
50f8987
cda4639
50f8987
 
 
 
 
 
cda4639
50f8987
 
 
 
654e910
 
 
 
50f8987
 
 
 
 
 
 
 
 
 
 
cda4639
 
50f8987
 
cda4639
 
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
34
# Use Node.js image for frontend
FROM node:20-slim AS frontend-builder

WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm install --legacy-peer-deps

COPY frontend/ ./
RUN npm run build

# Use Python image with uv pre-installed
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim

# Add DNS configuration
# RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf && \
#     echo "nameserver 8.8.4.4" >> /etc/resolv.conf

# Set up Node.js and npm
RUN apt-get update && apt-get install -y \
    curl \
    && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
    && apt-get install -y nodejs

WORKDIR /app

# Copy backend code
COPY backend/ backend/
COPY pyproject.toml .
RUN uv sync && uv pip install .
ENV PATH="/app/.venv/bin:/root/.local/bin:/root/.uv/venv/bin:${PATH}" 

# Copy frontend from builder
COPY --from=frontend-builder /app/frontend /app/frontend
COPY --from=frontend-builder /app/frontend/build /app/static