-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
24 lines (23 loc) · 898 Bytes
/
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
FROM golang:1.22 AS build
ARG DEBUG=false
ARG DOMAIN=localhost
ARG HTTP_PORT=8000
ARG HTTPS_PORT=4430
WORKDIR /usr/src/app
RUN apt-get update && apt-get -y install nodejs npm libcairo-dev rsync
RUN npm i -g google-closure-compiler
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN echo ${DEBUG} > DEBUG
RUN echo ${DOMAIN} > DOMAIN
RUN echo ${HTTP_PORT} > HTTP_PORT
RUN echo ${HTTPS_PORT} > HTTPS_PORT
RUN make
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout build/key -out build/cert -subj "/C=US/ST=XXX/L=XXX/O=XXX/CN=www.example.com"
FROM debian:bookworm
RUN apt-get update && apt-get -y install libcairo2
COPY --from=build /usr/src/app/build /usr/src/app/build
WORKDIR /usr/src/app/build
ENTRYPOINT ["/usr/src/app/build/vandal", "-f"]