forked from pushbits/server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (25 loc) · 775 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
35
36
37
38
FROM golang:alpine as builder
WORKDIR /build
COPY . .
RUN set -ex \
&& apk add --no-cache build-base \
&& go mod download \
&& go mod verify \
&& make build \
&& chmod +x /build/out/pushbits
FROM alpine
ARG USER_ID=1000
ENV PUSHBITS_HTTP_PORT="8080"
EXPOSE 8080
WORKDIR /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /build/out/pushbits ./run
RUN set -ex \
&& apk add --no-cache ca-certificates curl \
&& update-ca-certificates \
&& mkdir -p /data \
&& ln -s /data/pushbits.db /app/pushbits.db \
&& ln -s /data/config.yml /app/config.yml
USER ${USER_ID}
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s CMD curl --fail http://localhost:$PUSHBITS_HTTP_PORT/health || exit 1
ENTRYPOINT ["./run"]