-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile.api
40 lines (29 loc) · 938 Bytes
/
Dockerfile.api
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
# This Dockerfile is for building the API server
# Builder
FROM golang:1.23 AS builder
WORKDIR /opt/
RUN wget https://github.com/hashcat/hashcat/releases/download/v6.2.6/hashcat-6.2.6.7z -q -O hashcat.7z
RUN apt update -y
RUN apt install -y p7zip-full
RUN 7z x hashcat.7z
# Before copying all the source, first copy the dependency files
# This lets us download these and cache the downloads
COPY api/go.mod api/go.sum /app/api/
COPY common/go.mod common/go.sum /app/common/
WORKDIR /app/common
RUN go mod download -x
WORKDIR /app/api
RUN go mod download -x
# Now copy over the source code
COPY common /app/common/
COPY api /app/api/
COPY .git /app/.git/
RUN bash build.sh
# Runtime
FROM redhat/ubi9-micro AS runtime
WORKDIR /app
COPY --from=builder /app/api/phatcrack-api .
COPY --from=builder /opt/hashcat-6.2.6 /opt/hashcat/
RUN chmod 777 /opt/hashcat/
ENV HC_PATH=/opt/hashcat/hashcat.bin
ENTRYPOINT [ "/app/phatcrack-api" ]