forked from agola-io/agola
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
66 lines (42 loc) · 1.06 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
54
55
56
57
58
59
60
61
62
63
64
65
66
ARG AGOLAWEB_IMAGE="agola-web"
FROM $AGOLAWEB_IMAGE as agola-web
#######
####### Build the backend
#######
# base build image
FROM golang:1.18-buster AS build_base
WORKDIR /agola
# use go modules
ENV GO111MODULE=on
# only copy go.mod and go.sum
COPY go.mod .
COPY go.sum .
RUN go mod download
# builds the agola binaries
FROM build_base AS server_builder
# copy all the sources
COPY . .
# copy the agola-web dist
COPY --from=agola-web /agola-web/dist/ /agola-web/dist/
RUN make WEBBUNDLE=1 WEBDISTPATH=/agola-web/dist
#######
####### Build the final image
#######
FROM debian:buster AS agola
WORKDIR /
# Install git needed by gitserver
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
git \
&& rm -rf /var/lib/apt/lists/*
# copy to agola binaries
COPY --from=server_builder /agola/bin/agola /agola/bin/agola-toolbox-* /bin/
ENTRYPOINT ["/bin/agola"]
#######
####### Build the demo image
#######
FROM agola as agolademo
WORKDIR /
# copy the example config
COPY examples/agolademo/config.yml .
ENTRYPOINT ["/bin/agola"]