-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (28 loc) · 886 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
# build dependencies
FROM golang:1.20-alpine as dependencies
WORKDIR /build
RUN apk add --no-cache ca-certificates git
ENV GO111MODULE=on
ENV GOPRIVATE=github.com/futurehomeno
COPY .netrc /root/.netrc
RUN chmod 600 /root/.netrc
COPY src/go.mod src/go.sum ./
RUN go mod download
# Build container
FROM golang:1.20-alpine as builder
WORKDIR /build
COPY src /build
#copy built dependencies
COPY --from=dependencies /go /go
RUN CGO_ENABLED=0 GOOS=linux go build -o app-bin .
# Run container
FROM alpine
WORKDIR /app
RUN apk update && apk add bash
COPY --from=builder /build/app-bin .
COPY testdata/defaults/config-local.json ./defaults/config.json
COPY testdata/defaults/adapter.json ./defaults/adapter.json
COPY testdata/defaults/app-manifest.json ./defaults/app-manifes.json
COPY testdata/testing/configured/data/adapter.json ./data/adapter.json
EXPOSE 8005
CMD ["./app-bin"]