-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.build
More file actions
31 lines (27 loc) · 876 Bytes
/
Copy pathDockerfile.build
File metadata and controls
31 lines (27 loc) · 876 Bytes
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
ARG NODE_VERSION=12.8.0
ARG GOLANG_VERSION=1.12.9
# Frontend Dependencies (cache)
FROM node:${NODE_VERSION} as frontend-deps
WORKDIR /escapepod
ADD frontend-vue/yarn.lock frontend-vue/package.json frontend-vue/
RUN cd frontend-vue && yarn install
# Frontend build
FROM node:${NODE_VERSION} as frontend
WORKDIR /escapepod
COPY . .
COPY --from=frontend-deps /escapepod/frontend-vue/node_modules frontend-vue/node_modules
RUN make build-frontend
# Backend build
FROM golang:${GOLANG_VERSION} as build
RUN go get github.com/knadh/stuffbin/stuffbin
WORKDIR /escapepod
COPY . .
COPY --from=frontend /escapepod/frontend-vue/dist frontend-vue/dist
RUN make dist
# Production image
FROM alpine:latest AS deploy
RUN apk --no-cache add ca-certificates
WORKDIR /escapepod
COPY --from=build /escapepod/escapepod .
COPY escapepod.toml.sample escapepod.toml
CMD ["./escapepod", "serve"]