-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
78 lines (62 loc) · 2.03 KB
/
Dockerfile
File metadata and controls
78 lines (62 loc) · 2.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
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
68
69
70
71
72
73
74
75
76
77
78
# Multi-architecture Dockerfile for Crypto Transaction Tracker
# Supports both ARM64 (aarch64) and AMD64 (x86_64) for NAS deployment
FROM python:3.11-slim
# Set build arguments for cross-platform support
ARG TARGETPLATFORM
ARG BUILDPLATFORM
# Metadata
LABEL maintainer="robertbiv"
LABEL description="Crypto Transaction Tracker - Multi-architecture NAS deployment"
LABEL version="1.0"
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
DEBIAN_FRONTEND=noninteractive
# Set working directory
WORKDIR /app
# Install system dependencies
# These are minimal and work on both ARM and x86
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
g++ \
libffi-dev \
libssl-dev \
curl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements files
COPY requirements.txt requirements-ml.txt ./
# Install Python dependencies
# Install main requirements first
RUN pip install --upgrade pip setuptools wheel && \
pip install -r requirements.txt
# Install ML requirements (optional, larger packages)
# Install with --no-deps to avoid conflicts, then install missing deps
RUN pip install -r requirements-ml.txt || \
echo "Some ML packages may have failed, continuing..."
# Copy application code
COPY . .
# Copy and set up entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Create necessary directories with proper permissions
RUN mkdir -p /app/inputs \
/app/outputs \
/app/outputs/logs \
/app/processed_archive \
/app/configs \
/app/certs \
/app/web_static \
/app/web_templates && \
chmod -R 777 /app
# Set entrypoint
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
# Expose port for web UI
EXPOSE 5000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f -k https://localhost:5000/health || exit 1
# Default command - run web UI
CMD ["python", "start_web_ui.py"]