@@ -4,15 +4,26 @@ WORKDIR /app
44
55COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
66
7- COPY pyproject.toml uv.lock* ./
8-
9- RUN uv pip install --system nats-py aiohttp || \
10- (uv pip compile pyproject.toml -o requirements.txt && \
11- uv pip install --system -r requirements.txt)
12-
7+ # Copy project files needed for installation
8+ COPY pyproject.toml uv.lock* README.md ./
139COPY src/ ./src/
14-
15- RUN useradd -m -u 1000 nodeuser && chown -R nodeuser:nodeuser /app
10+ COPY dfx/ ./dfx/
11+
12+ # Install dependencies and the package
13+ RUN uv pip compile pyproject.toml -o requirements.txt && \
14+ uv pip install --system -r requirements.txt && \
15+ uv pip install --system .
16+
17+ # Copy node configuration, models, and startup script
18+ COPY node.json ./
19+ COPY models/ ./models/
20+ COPY scripts/ ./scripts/
21+ COPY start-local.sh ./
22+
23+ # Create non-root user and make script executable
24+ RUN useradd -m -u 1000 nodeuser && \
25+ chown -R nodeuser:nodeuser /app && \
26+ chmod +x /app/start-local.sh
1627USER nodeuser
1728
1829ENV PYTHONPATH=/app
@@ -24,5 +35,5 @@ EXPOSE ${NODE_PORT}
2435HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
2536 CMD python -c "import sys; sys.exit(0)" || exit 1
2637
27- CMD ["sh" , "-c" , "exec uv run python -m node.main --port=${NODE_PORT:-8000} " ]
38+ CMD ["./start-local.sh " ]
2839
0 commit comments