Dockerfile 666 Bytes
Newer Older
Orne Brocaar's avatar
Orne Brocaar committed
1
FROM golang:1.17-alpine AS development
Orne Brocaar's avatar
Orne Brocaar committed
2

3
ENV PROJECT_PATH=/chirpstack-application-server
Orne Brocaar's avatar
Orne Brocaar committed
4
ENV PATH=$PATH:$PROJECT_PATH/build
Orne Brocaar's avatar
Orne Brocaar committed
5
6
ENV CGO_ENABLED=0
ENV GO_EXTRA_BUILD_ARGS="-a -installsuffix cgo"
Orne Brocaar's avatar
Orne Brocaar committed
7

8
RUN apk add --no-cache ca-certificates make git bash alpine-sdk nodejs npm
Orne Brocaar's avatar
Orne Brocaar committed
9
10

RUN mkdir -p $PROJECT_PATH
11
COPY . $PROJECT_PATH
Orne Brocaar's avatar
Orne Brocaar committed
12
WORKDIR $PROJECT_PATH
tamagohan's avatar
tamagohan committed
13

Orne Brocaar's avatar
Orne Brocaar committed
14
RUN make dev-requirements ui-requirements
15
16
RUN make

Orne Brocaar's avatar
Orne Brocaar committed
17
FROM alpine:3.15.0 AS production
18
19

RUN apk --no-cache add ca-certificates
20
COPY --from=development /chirpstack-application-server/build/chirpstack-application-server /usr/bin/chirpstack-application-server
21
USER nobody:nogroup
22
ENTRYPOINT ["/usr/bin/chirpstack-application-server"]