-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
50 lines (36 loc) · 1.49 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
# ==============================================================================
# ========= build golang project ===============================================
# ==============================================================================
FROM golang:latest as buildgo
WORKDIR /app
# ========= build project ======================================================
# install dependencies
COPY go.mod go.sum ./
RUN go mod download
# copy and build source
COPY ./cache/ ./cache/
COPY ./cli/ ./cli/
COPY ./config/ ./config/
COPY ./handlers/ ./handlers/
COPY ./models/ ./models/
COPY ./server/ ./server/
COPY ./utils/ ./utils/
COPY ./main.go .
RUN go build -o openefs .
# ========= test project =======================================================
RUN go test ./...
# ==============================================================================
# ========= test python code ===================================================
# ==============================================================================
FROM tensorflow/tensorflow:latest-py3 as testpython
WORKDIR /app
# TODO: write tests
# ==============================================================================
# ========= build execution-environment ========================================
# ==============================================================================
FROM alpine:latest as runner
RUN apk --no-cache add ca-certificates
WORKDIR /app
COPY --from=buildgo /app/openefs .
# TODO: copy relevant python code
CMD ["./openefs"]