forked from peer-calls/peer-calls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (36 loc) · 926 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM node:16-alpine as frontend
# Add dependency instructions and fetch node_modules
COPY package.json package-lock.json /src/
WORKDIR /src
RUN set -ex \
&& apk add --no-cache \
git \
&& npm ci
# Add the application itself
COPY ./ /src/
RUN set -ex \
&& npm run build
FROM golang:alpine as server
ENV CGO_ENABLED=0
RUN set -ex \
&& apk add --no-cache \
git
# Add dependencies into mod cache
COPY go.mod go.sum /src/
WORKDIR /src
RUN set -ex \
&& go mod download
# Add the application itself and build it
COPY ./ /src/
COPY --from=frontend /src/build/ /src/build/
ARG VERSION
RUN set -ex \
&& go build \
-ldflags "-X main.GitDescribe=$(git describe --always --tags --dirty)" \
-mod=readonly \
-o peer-calls
FROM scratch
COPY --from=server /src/peer-calls /usr/local/bin/
EXPOSE 3000/tcp
STOPSIGNAL SIGINT
ENTRYPOINT ["/usr/local/bin/peer-calls"]