Lightest dockerfile

This commit is contained in:
Zeecka
2026-01-05 18:01:40 +01:00
parent 6e0ec35bc8
commit 82cdeabd2f
5 changed files with 46 additions and 33 deletions
+6
View File
@@ -0,0 +1,6 @@
.git
__pycache__
*.pyc
tests
docs
exemples
+2 -2
View File
@@ -148,10 +148,10 @@ docker exec -it aperisolve-web bash
docker exec -it postgres psql -U aperiuser -d aperisolve
# Backup all uploaded files
docker cp -r aperisolve-web:/aperisolve/results /path/to/backup/location
docker cp -r aperisolve-web:/app/aperisolve/results /path/to/backup/location
# Backup a single uploaded file
docker cp aperisolve-web:/aperisolve/results/filename.ext /path/to/backup/filename.ext
docker cp aperisolve-web:/app/aperisolve/results/filename.ext /path/to/backup/filename.ext
```
> [!WARNING]
+34 -27
View File
@@ -1,17 +1,31 @@
FROM python:3.14-slim AS build
# ==========================
# Stage 1 : Builder (download OpenStego)
# ==========================
FROM python:3.14-slim AS builder
WORKDIR /
# Install build tools and dependencies
RUN apt-get update && apt-get install -y \
# Install wget only to download OpenStego
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
default-jdk \
&& rm -rf /var/lib/apt/lists/*
# Download OpenStego
RUN wget https://github.com/syvaidya/openstego/releases/download/openstego-0.8.6/openstego_0.8.6-1_all.deb \
-O /tmp/openstego.deb
# ==========================
# Stage 2 : Image runtime minimale
# ==========================
FROM python:3.14-slim
WORKDIR /app
# Install runtime + stego tools
RUN apt-get update && apt-get install -y --no-install-recommends \
default-jre \
file \
ruby \
zip \
7zip
# Install steganography and forensics tools
RUN apt-get update && apt-get install -y \
p7zip-full \
binwalk \
foremost \
exiftool \
@@ -19,27 +33,20 @@ RUN apt-get update && apt-get install -y \
binutils \
outguess \
pngcheck \
&& gem install zsteg
&& gem install zsteg \
&& rm -rf /var/lib/apt/lists/*
# Install OpenStego
RUN wget https://github.com/syvaidya/openstego/releases/download/openstego-0.8.6/openstego_0.8.6-1_all.deb -O /tmp/openstego.deb && \
dpkg -i /tmp/openstego.deb && \
rm /tmp/openstego.deb
COPY --from=builder /tmp/openstego.deb /tmp/openstego.deb
RUN dpkg -i /tmp/openstego.deb || apt-get install -f -y --no-install-recommends \
&& rm -rf /tmp/openstego.deb \
&& rm -rf /var/lib/apt/lists/*
# Copy application
COPY aperisolve/ /aperisolve/
RUN mkdir -p /data
# Copy app
COPY aperisolve/ /app/aperisolve/
# Install Python dependencies
RUN pip install --no-cache-dir -r /aperisolve/requirements.txt
ENV PYTHONUNBUFFERED=1
# Auto clean after build
RUN apt-get remove -y wget && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir -r /app/aperisolve/requirements.txt
# Commande de lancement
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "--access-logfile", "-", "--error-logfile", "-", "--log-level", "info", "--capture-output", "aperisolve.wsgi:application"]
+2 -2
View File
@@ -8,7 +8,7 @@ services:
ports:
- "5000:5000"
volumes:
- ./aperisolve:/aperisolve
- ./aperisolve:/app/aperisolve
depends_on:
postgres:
condition: service_healthy
@@ -30,7 +30,7 @@ services:
restart: always
command: rq worker default --url redis://redis:6379/0
volumes:
- ./aperisolve:/aperisolve
- ./aperisolve:/app/aperisolve
depends_on:
- redis
- postgres
+2 -2
View File
@@ -7,7 +7,7 @@ services:
ports:
- "5000:5000"
volumes:
- apresults:/aperisolve/results
- apresults:/app/aperisolve/results
depends_on:
postgres:
condition: service_healthy
@@ -31,7 +31,7 @@ services:
restart: always
command: rq worker default --url redis://redis:6379/0
volumes:
- apresults:/aperisolve/results
- apresults:/app/aperisolve/results
depends_on:
- redis
- postgres