-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
34 lines (32 loc) · 830 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
25
26
27
28
29
30
31
32
33
34
FROM node:14
WORKDIR /app
COPY package.json .
COPY package-lock.json .
COPY scripts scripts
COPY index.html .
COPY tailwind.config.js .
COPY postcss.config.js .
RUN npm install --silent && ./scripts/build-css.sh
FROM golang:1.16-alpine
COPY . /app
ENV NODE_ENV=production
ENV CGO_ENABLED=0
COPY --from=0 /app/dist dist
RUN cd /app && \
go vet ./... && \
go test ./... && \
go build -o /tmp/patrol ./cmd/patrol
FROM alpine:3.9
LABEL org.opencontainers.image.source https://github.com/karimsa/patrol
RUN apk add --no-cache \
curl \
iputils
COPY --from=1 /tmp/patrol /usr/local/bin/patrol
RUN addgroup -S patrol && \
adduser -S patrol -G patrol && \
mkdir /data && \
chown -R patrol /data && \
chmod 0755 /data
WORKDIR /data
USER patrol
ENTRYPOINT ["patrol"]