forked from caraml-dev/mlp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
27 lines (25 loc) · 850 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
# ============================================================
# Build stage 1: Build UI
# ============================================================
FROM node:14-alpine as node-builder
WORKDIR /src/ui
COPY ui .
RUN yarn
RUN yarn lib build
RUN yarn app build
# ============================================================
# Build stage 2: Build API
# ============================================================
FROM golang:1.14-alpine as go-builder
WORKDIR /src/api
COPY api api/
COPY go.mod .
COPY go.sum .
RUN go build -o bin/mlp-api ./api/cmd/main.go
# ============================================================
# Build stage 3: Run the app
# ============================================================
FROM alpine:3.12
COPY --from=node-builder /src/ui/build ./ui/build
COPY --from=go-builder /src/api/bin/mlp-api /usr/bin/mlp
CMD ["mlp"]