-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 1.03 KB
/
Dockerfile
File metadata and controls
37 lines (26 loc) · 1.03 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
# Canopy — Dockerfile
# Base: python:3.12-slim (Python 3.10+ required per pyproject.toml)
FROM python:3.12-slim
# Create a non-root user for security
RUN useradd --create-home --shell /bin/bash canopy
WORKDIR /app
# Install dependencies first for better layer caching
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy the full project source
COPY . .
# Create data and logs directories and make the entrypoint executable
RUN mkdir -p /app/data /app/logs && \
chmod +x /app/docker-entrypoint.sh && \
chown -R canopy:canopy /app
# Switch to non-root user
USER canopy
# Persistent data and logs as volumes
VOLUME ["/app/data", "/app/logs"]
# Environment variables — read by Config.from_env() at runtime
ENV CANOPY_DATA_DIR=/app/data
# Expose Web UI / REST API and P2P mesh ports
EXPOSE 7770 7771
# docker-entrypoint.sh initialises the DB on the live volume then exec's the app.
# Extra CLI args (e.g. --debug) can be appended to `docker run` or CMD override.
ENTRYPOINT ["/app/docker-entrypoint.sh"]