-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (39 loc) · 1.08 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
51
52
53
#####################
### Server Build Step
#####################
FROM golang:1.16.6-buster AS server-builder
ARG buildnumber=local
RUN mkdir /server
WORKDIR /server
COPY . .
RUN BUILDNUMBER=${buildnumber} GOOS=linux GOARCH=amd64 make build-server
#################
### UI Build Step
#################
FROM node:16-buster AS ui-builder
RUN mkdir /ui
WORKDIR /ui
COPY . .
RUN npm ci
RUN make build-ssr
RUN make build-ui
################
### Runtime Step
################
FROM debian:buster-slim
RUN apt-get update
RUN apt-get install -y ca-certificates
RUN mkdir /app
WORKDIR /app
COPY --from=server-builder /server/migrations /app/migrations
COPY --from=server-builder /server/views /app/views
COPY --from=server-builder /server/locale /app/locale
COPY --from=server-builder /server/LICENSE /app
COPY --from=server-builder /server/fider /app
COPY --from=ui-builder /ui/favicon.png /app
COPY --from=ui-builder /ui/dist /app/dist
COPY --from=ui-builder /ui/robots.txt /app
COPY --from=ui-builder /ui/ssr.js /app
EXPOSE 3000
HEALTHCHECK --timeout=5s CMD ./fider ping
CMD ./fider migrate && ./fider