github.com/lunarobliq/gophish@v0.8.1-0.20230523153303-93511002234d/Dockerfile (about) 1 # Minify client side assets (JavaScript) 2 FROM node:latest AS build-js 3 4 RUN npm install gulp gulp-cli -g 5 6 WORKDIR /build 7 COPY . . 8 RUN npm install --only=dev 9 RUN gulp 10 11 12 # Build Golang binary 13 FROM golang:1.15.2 AS build-golang 14 15 WORKDIR /go/src/github.com/gophish/gophish 16 COPY . . 17 RUN go get -v && go build -v 18 19 20 # Runtime container 21 FROM debian:stable-slim 22 23 RUN useradd -m -d /opt/gophish -s /bin/bash app 24 25 RUN apt-get update && \ 26 apt-get install --no-install-recommends -y jq libcap2-bin && \ 27 apt-get clean && \ 28 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 29 30 WORKDIR /opt/gophish 31 COPY --from=build-golang /go/src/github.com/gophish/gophish/ ./ 32 COPY --from=build-js /build/static/js/dist/ ./static/js/dist/ 33 COPY --from=build-js /build/static/css/dist/ ./static/css/dist/ 34 COPY --from=build-golang /go/src/github.com/gophish/gophish/config.json ./ 35 RUN chown app. config.json 36 37 RUN setcap 'cap_net_bind_service=+ep' /opt/gophish/gophish 38 39 USER app 40 RUN sed -i 's/127.0.0.1/0.0.0.0/g' config.json 41 RUN touch config.json.tmp 42 43 EXPOSE 3333 8080 8443 80 44 45 CMD ["./docker/run.sh"]