-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (24 loc) · 820 Bytes
/
Dockerfile
File metadata and controls
35 lines (24 loc) · 820 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
# Multi-stage build using pixi for reproducible dependencies
FROM ghcr.io/prefix-dev/pixi:latest AS builder
WORKDIR /build
# Copy pixi project files
COPY pixi.toml pixi.lock ./
# Copy source code for package installation
COPY pyproject.toml README.md ./
COPY src/ ./src/
# Install dependencies from lock file (production environment only, no dev dependencies)
RUN pixi install --locked --environment default
# Final stage - use a slim Python image
FROM python:3.11-slim
WORKDIR /app
# Copy the pixi environment from builder
COPY --from=builder /build/.pixi/envs/default /opt/conda
# Copy source code and templates
COPY src/ /app/src/
COPY templates/ /app/templates/
# Add conda environment to PATH
ENV PATH=/opt/conda/bin:$PATH
# Expose port
EXPOSE 8000
# Run the application
CMD ["python", "-m", "src.main"]