Lightest dockerfile
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
.git
|
||||||
|
__pycache__
|
||||||
|
*.pyc
|
||||||
|
tests
|
||||||
|
docs
|
||||||
|
exemples
|
||||||
+2
-2
@@ -148,10 +148,10 @@ docker exec -it aperisolve-web bash
|
|||||||
docker exec -it postgres psql -U aperiuser -d aperisolve
|
docker exec -it postgres psql -U aperiuser -d aperisolve
|
||||||
|
|
||||||
# Backup all uploaded files
|
# 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
|
# 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]
|
> [!WARNING]
|
||||||
|
|||||||
+34
-27
@@ -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 wget only to download OpenStego
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
# Install build tools and dependencies
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
wget \
|
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 \
|
ruby \
|
||||||
zip \
|
zip \
|
||||||
7zip
|
p7zip-full \
|
||||||
|
|
||||||
# Install steganography and forensics tools
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
binwalk \
|
binwalk \
|
||||||
foremost \
|
foremost \
|
||||||
exiftool \
|
exiftool \
|
||||||
@@ -19,27 +33,20 @@ RUN apt-get update && apt-get install -y \
|
|||||||
binutils \
|
binutils \
|
||||||
outguess \
|
outguess \
|
||||||
pngcheck \
|
pngcheck \
|
||||||
&& gem install zsteg
|
&& gem install zsteg \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install OpenStego
|
# 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 && \
|
COPY --from=builder /tmp/openstego.deb /tmp/openstego.deb
|
||||||
dpkg -i /tmp/openstego.deb && \
|
RUN dpkg -i /tmp/openstego.deb || apt-get install -f -y --no-install-recommends \
|
||||||
rm /tmp/openstego.deb
|
&& rm -rf /tmp/openstego.deb \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy application
|
# Copy app
|
||||||
COPY aperisolve/ /aperisolve/
|
COPY aperisolve/ /app/aperisolve/
|
||||||
|
|
||||||
RUN mkdir -p /data
|
|
||||||
|
|
||||||
# Install Python dependencies
|
# Install Python dependencies
|
||||||
RUN pip install --no-cache-dir -r /aperisolve/requirements.txt
|
RUN pip install --no-cache-dir -r /app/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/*
|
|
||||||
|
|
||||||
|
# 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"]
|
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "--access-logfile", "-", "--error-logfile", "-", "--log-level", "info", "--capture-output", "aperisolve.wsgi:application"]
|
||||||
|
|||||||
+2
-2
@@ -8,7 +8,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "5000:5000"
|
- "5000:5000"
|
||||||
volumes:
|
volumes:
|
||||||
- ./aperisolve:/aperisolve
|
- ./aperisolve:/app/aperisolve
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -30,7 +30,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
command: rq worker default --url redis://redis:6379/0
|
command: rq worker default --url redis://redis:6379/0
|
||||||
volumes:
|
volumes:
|
||||||
- ./aperisolve:/aperisolve
|
- ./aperisolve:/app/aperisolve
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
- postgres
|
- postgres
|
||||||
|
|||||||
+2
-2
@@ -7,7 +7,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "5000:5000"
|
- "5000:5000"
|
||||||
volumes:
|
volumes:
|
||||||
- apresults:/aperisolve/results
|
- apresults:/app/aperisolve/results
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -31,7 +31,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
command: rq worker default --url redis://redis:6379/0
|
command: rq worker default --url redis://redis:6379/0
|
||||||
volumes:
|
volumes:
|
||||||
- apresults:/aperisolve/results
|
- apresults:/app/aperisolve/results
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
- postgres
|
- postgres
|
||||||
|
|||||||
Reference in New Issue
Block a user