-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (52 loc) · 1.81 KB
/
Dockerfile
File metadata and controls
67 lines (52 loc) · 1.81 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# =============================================================================
# DataMgmt Node - Unified Deployment
# Combines: Static Website (nginx) + Python Node (API + WebSocket)
# =============================================================================
# Stage 1: Build the Astro website
FROM node:22-alpine AS website-builder
WORKDIR /website
COPY website/package*.json ./
RUN npm ci
COPY website/ ./
RUN npm run build
# Stage 2: Python runtime with website
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
nginx \
supervisor \
libleveldb-dev \
build-essential \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies via pip (simpler than poetry in Docker)
WORKDIR /app
# Install Python packages
RUN pip install --no-cache-dir \
asyncio==3.4.3 \
cryptography==43.0.0 \
web3==6.20.1 \
aiohttp==3.9.0 \
plyvel==1.5.1 \
python-dotenv==1.0.0 \
kademlia==2.2.3
# Copy DataMgmt Node source
COPY datamgmtnode ./datamgmtnode
COPY contracts ./contracts
COPY plugins ./plugins
# Create data directories
RUN mkdir -p /app/data /var/log/supervisor /var/log/nginx
# Copy website static files
COPY --from=website-builder /website/dist /usr/share/nginx/html
# Copy deployment configuration
COPY deploy/nginx.conf /etc/nginx/nginx.conf
COPY deploy/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY deploy/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Expose port 80 (nginx handles all routing)
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost/health || exit 1
ENTRYPOINT ["/entrypoint.sh"]
CMD ["supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"]