-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·76 lines (54 loc) · 1.59 KB
/
Dockerfile
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
ARG basev=base
FROM ubuntu:noble AS clam_base
ENV DEBIAN_FRONTEND=noninteractiv
RUN apt-get update --fix-missing
RUN apt-get update
RUN apt-get install -y clamav \
clamav-daemon \
clamav-freshclam \
cron \
pipx
RUN touch /var/log/freshclam.log
RUN chmod 600 /var/log/freshclam.log
RUN chown clamav /var/log/freshclam.log
COPY clamav_config/freshclam.conf /etc/clamav/freshclam.conf
RUN chmod 0600 /etc/clamav/freshclam.conf
RUN chown clamav /etc/clamav/freshclam.conf
COPY clamav_config/clamd.conf /etc/clamav/clamd.conf
RUN chmod 0600 /etc/clamav/clamd.conf
RUN chown clamav /etc/clamav/clamd.conf
RUN mkdir /opt/clamav
COPY clamdb/bytecode.cvd /opt/clamav/bytecode.cvd
COPY clamdb/daily.cvd /opt/clamav/daily.cvd
COPY clamdb/main.cvd /opt/clamav/main.cvd
RUN chown -R clamav /opt/clamav/
RUN mkdir /var/run/clamav
RUN touch /var/run/clamav/clamd.ctl
RUN chown clamav /var/run/clamav/clamd.ctl
FROM clam_base AS clam_cron
COPY clamav_config/freshclam_cron /etc/cron.d/freshclam
RUN chmod 0500 /etc/cron.d/freshclam
RUN crontab /etc/cron.d/freshclam
RUN touch /var/log/cron.log
CMD cron
FROM clam_${basev} AS final
ENV PYTHONPATH=/app
ENV CLAMD_CONN=socket
ENV PATH=${PATH}:/root/.local/bin
EXPOSE 8080
RUN pipx install uv
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
RUN mkdir /app
COPY /scancan /app
COPY pyproject.toml /app
COPY uv.lock /app
COPY LICENSE /app
COPY README.md /app
WORKDIR /app
RUN uv sync --frozen
COPY "./entrypoint.sh" "/entrypoint.sh"
RUN chmod 0500 /entrypoint.sh
RUN chown clamav /entrypoint.sh
USER clamav
ENV PATH="/app/.venv/bin:$PATH"
ENTRYPOINT [ "/entrypoint.sh" ]