-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (37 loc) · 1.53 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (37 loc) · 1.53 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
51
# Wake server — multistage build.
#
# Stage 1 builds a wheel; stage 2 installs it into a clean slim image
# and runs `wake server`. The entrypoint is `wake`, so by default the
# container starts the API server on :8080.
FROM python:3.11-slim AS builder
WORKDIR /build
# Keep the build layer cacheable: install build tooling, then copy
# source. (We don't need full system deps because hatchling is pure
# Python.)
RUN python -m pip install --no-cache-dir --upgrade pip build
COPY pyproject.toml README.md ./
COPY src/ ./src/
RUN python -m build --wheel --outdir /build/dist
FROM python:3.11-slim
LABEL org.opencontainers.image.title="wake"
LABEL org.opencontainers.image.description="Wake — durable runtime substrate for AI agents."
LABEL org.opencontainers.image.source="https://github.com/raphaelchristi/wake"
LABEL org.opencontainers.image.licenses="Apache-2.0"
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
WAKE_HOME=/data/wake
WORKDIR /app
# Install the wheel built in stage 1. We pull in the *runtime* deps
# (FastAPI, uvicorn, etc.) only — dev deps stay in the builder.
COPY --from=builder /build/dist/*.whl /tmp/
RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl
# Non-root user for the running container. The data dir gets owned by
# this user so SQLite + workspaces work without root.
RUN useradd --create-home --uid 10001 wake \
&& mkdir -p /data/wake \
&& chown -R wake:wake /data
USER wake
EXPOSE 8080
ENTRYPOINT ["wake"]
CMD ["server", "--host", "0.0.0.0", "--port", "8080"]