-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (30 loc) · 935 Bytes
/
Dockerfile
File metadata and controls
39 lines (30 loc) · 935 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
34
35
36
37
38
39
# Build stage for UI
FROM node:18-slim AS ui-builder
WORKDIR /app/cloudproxy-ui
# Copy only package files first to leverage cache
COPY cloudproxy-ui/package*.json ./
RUN npm install
# Copy UI source and build
COPY cloudproxy-ui/ ./
RUN npm run build
# Final stage
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy Python requirements and install dependencies
COPY requirements.txt .
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --no-cache-dir -r requirements.txt
# Copy Python source code
COPY cloudproxy/ cloudproxy/
# Copy built UI files from ui-builder stage
COPY --from=ui-builder /app/cloudproxy-ui/dist cloudproxy-ui/dist
# Set Python path and expose port
ENV PYTHONPATH=/app
EXPOSE 8000
# Run the application
CMD ["python", "./cloudproxy/main.py"]