-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile-worker
More file actions
45 lines (32 loc) · 1.12 KB
/
Dockerfile-worker
File metadata and controls
45 lines (32 loc) · 1.12 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
FROM kalilinux/kali-last-release:latest AS kali
# Install packages
RUN apt update && apt install -y \
python3.12 \
medusa \
nmap \
wpscan \
ffuf \
&& rm -rf /var/lib/apt/lists/*
FROM registry.gitlab.ics.muni.cz:443/cryton/cryton/production-base:latest AS base
# Set environment
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
WORKDIR /app
# Install dependencies
COPY poetry.lock pyproject.toml ./
RUN poetry install --without dev --no-root --no-interaction --no-ansi -E worker
# Install app
COPY . .
RUN poetry install --only-root --no-interaction --no-ansi -E worker
FROM kali AS production
# Set environment
ENV CRYTON_APP_DIRECTORY=/app
# Copy app
COPY --from=base /app /app
# Make the executable accessible
RUN ln -s /app/.venv/bin/cryton-worker /usr/local/bin/cryton-worker
# Relink Python executable in the virtual environment
RUN ln -s -f /usr/bin/python3.12 /app/.venv/bin/python
# Enable shell autocompletion
RUN _CRYTON_WORKER_COMPLETE=bash_source cryton-worker > /etc/profile.d/cryton-worker-complete.sh
RUN echo ". /etc/profile.d/cryton-worker-complete.sh" >> ~/.bashrc
CMD [ "cryton-worker", "start" ]