-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (37 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
50 lines (37 loc) · 1.09 KB
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
40
41
42
43
44
45
46
47
48
49
50
FROM python:3.12-alpine
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apk add --no-cache \
git \
curl \
build-base \
libffi-dev \
openssl-dev
# Install uv
RUN pip install uv
# Copy pyproject.toml, pyproject.lock, and README.md first for better caching
COPY pyproject.toml pyproject.lock* README.md ./
# Install production dependencies only (no dev dependencies)
RUN uv pip install --system .
# Copy source code
COPY src/ ./src/
COPY server.py ./
# Copy CLI installation script
COPY scripts/install_cli.sh /tmp/install_cli.sh
RUN chmod +x /tmp/install_cli.sh
# Install CLI as root (before creating non-root user)
# This will download the correct architecture binary from GitHub releases
RUN /tmp/install_cli.sh
# Create a non-root user
RUN adduser -D -u 1000 cycloid
# Fix permissions for the cycloid user
RUN chown -R cycloid:cycloid /app && \
chmod -R 755 /app
USER cycloid
# Set environment variables for production
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
ENV CY_CLI_PATH=/usr/local/bin/cy
# Run server directly with Python
CMD ["python3", "server.py"]