Samuraiog commited on
Commit
4cb2999
·
verified ·
1 Parent(s): b55cb0c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -33
Dockerfile CHANGED
@@ -1,54 +1,33 @@
1
- # Multi-stage Docker build for Phoenix Fury API v7.0
2
- FROM python:3.11-slim as builder
3
 
4
  ENV PYTHONUNBUFFERED=1 \
5
- PYTHONDONTWRITEBYTECODE=1 \
6
- PIP_NO_CACHE_DIR=1 \
7
- PIP_DISABLE_PIP_VERSION_CHECK=1
8
 
9
- # Install build dependencies
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
  gcc \
12
  g++ \
13
  make \
14
  libffi-dev \
15
- python3-dev \
16
- && rm -rf /var/lib/apt/lists/*
17
-
18
- # Copy requirements and install Python dependencies
19
- COPY requirements.txt /tmp/
20
- RUN pip install --user --no-cache-dir -r /tmp/requirements.txt
21
-
22
- # Final stage
23
- FROM python:3.11-slim
24
-
25
- ENV PYTHONUNBUFFERED=1 \
26
- PYTHONDONTWRITEBYTECODE=1 \
27
- PATH=/root/.local/bin:$PATH
28
-
29
- # Install runtime dependencies
30
- RUN apt-get update && apt-get install -y --no-install-recommends \
31
  libcap2-bin \
32
  && rm -rf /var/lib/apt/lists/*
33
 
34
- # Copy Python dependencies from builder
35
- COPY --from=builder /root/.local /root/.local
36
-
37
- # Create app directory
38
  WORKDIR /app
39
 
 
 
 
 
 
40
  # Copy application code
41
- COPY main.py /app/
42
 
43
- # Grant raw socket capabilities (for L4 attacks without full root)
44
  RUN setcap cap_net_raw+ep /usr/local/bin/python3.11 || true
45
 
46
  # Expose API port
47
  EXPOSE 8000
48
 
49
- # Health check
50
- HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
51
- CMD python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/').read()" || exit 1
52
-
53
  # Run the application
54
- CMD ["python3", "main.py"]
 
1
+ FROM python:3.11-slim
 
2
 
3
  ENV PYTHONUNBUFFERED=1 \
4
+ PYTHONDONTWRITEBYTECODE=1
 
 
5
 
6
+ # Install system dependencies
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
  gcc \
9
  g++ \
10
  make \
11
  libffi-dev \
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  libcap2-bin \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Set working directory
 
 
 
16
  WORKDIR /app
17
 
18
+ # Copy and install Python dependencies
19
+ COPY requirements.txt .
20
+ RUN pip install --no-cache-dir --upgrade pip && \
21
+ pip install --no-cache-dir -r requirements.txt
22
+
23
  # Copy application code
24
+ COPY main.py .
25
 
26
+ # Grant raw socket capabilities
27
  RUN setcap cap_net_raw+ep /usr/local/bin/python3.11 || true
28
 
29
  # Expose API port
30
  EXPOSE 8000
31
 
 
 
 
 
32
  # Run the application
33
+ CMD ["python3", "main.py"]