Skip to content

Commit 0dcf194

Browse files
committed
fix: Dockerfile
1 parent c91929e commit 0dcf194

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
.gitattributes
55

66
# Documentation
7-
README.md
87
docs/
98
*.md
9+
!README.md
1010

1111
# Tests
1212
tests/

Dockerfile

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,26 @@ WORKDIR /app
44

55
COPY --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 ./
139
COPY 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
1627
USER nodeuser
1728

1829
ENV PYTHONPATH=/app
@@ -24,5 +35,5 @@ EXPOSE ${NODE_PORT}
2435
HEALTHCHECK --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

Comments
 (0)