-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile
57 lines (49 loc) · 1.31 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
########
# BASE #
########
ARG DEBIAN_VERSION="bookworm"
ARG GO_VERSION="1.23"
ARG NODE_VERSION="22"
ARG ALPINE_VERSION="3.21"
FROM golang:${GO_VERSION}-${DEBIAN_VERSION} AS go_builder
FROM node:${NODE_VERSION}-${DEBIAN_VERSION} AS base
COPY --from=go_builder /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"
RUN npm install -g npm@latest
COPY . /build/
WORKDIR /build/
ARG BUILD_VERSION="development"
RUN make BUILD_VERSION=${BUILD_VERSION} build \
&& chmod 755 /build/argus \
&& chmod 755 /build/healthcheck
#########
# ARGUS #
#########
FROM alpine:${ALPINE_VERSION}
LABEL maintainer="The Argus Authors <[email protected]>"
RUN \
apk update && \
apk add --no-cache \
ca-certificates \
curl \
musl-dev \
su-exec && \
rm -rf \
/tmp/* \
/var/cache/*
COPY entrypoint.sh /entrypoint.sh
COPY --from=base /build/argus /usr/bin/argus
COPY --from=base /build/healthcheck /healthcheck
COPY --from=base /build/config.yml.example /app/config.yml
COPY --from=base /build/LICENSE /LICENSE
RUN \
addgroup -g 911 -S argus && \
adduser -u 911 -S -D -h /app -s /bin/false argus -G argus && \
mkdir -p \
/app \
/app/data && \
chown -R argus:argus /app
WORKDIR /app
EXPOSE 8080
VOLUME [ "/app/data" ]
ENTRYPOINT [ "/entrypoint.sh" ]