2019-02-21 15:10:30 +00:00
|
|
|
#######
|
|
|
|
####### Build the backend
|
|
|
|
#######
|
|
|
|
|
2019-05-09 10:36:30 +00:00
|
|
|
# base build image
|
2019-02-21 15:10:30 +00:00
|
|
|
FROM golang:1.11 AS build_base
|
|
|
|
|
|
|
|
WORKDIR /agola
|
|
|
|
|
|
|
|
# use go modules
|
|
|
|
ENV GO111MODULE=on
|
|
|
|
|
2019-05-09 10:36:30 +00:00
|
|
|
# only copy go.mod and go.sum
|
2019-02-21 15:10:30 +00:00
|
|
|
COPY go.mod .
|
|
|
|
COPY go.sum .
|
|
|
|
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
# This image builds the weavaite server
|
|
|
|
FROM build_base AS server_builder
|
|
|
|
|
2019-05-09 10:36:30 +00:00
|
|
|
# copy all the source
|
2019-02-21 15:10:30 +00:00
|
|
|
COPY . .
|
|
|
|
|
2019-05-09 10:36:30 +00:00
|
|
|
# copy the agola-web dist
|
2019-02-21 15:10:30 +00:00
|
|
|
COPY --from=agola-web /agola-web/dist/ /agola-web/dist/
|
|
|
|
|
|
|
|
RUN make WEBBUNDLE=1 WEBDISTPATH=/agola-web/dist
|
|
|
|
|
|
|
|
|
|
|
|
#######
|
|
|
|
####### Build the final image
|
|
|
|
#######
|
2019-05-08 13:40:11 +00:00
|
|
|
FROM debian:stable AS agola
|
2019-02-21 15:10:30 +00:00
|
|
|
|
2019-04-03 06:52:00 +00:00
|
|
|
WORKDIR /
|
2019-02-21 15:10:30 +00:00
|
|
|
|
2019-05-22 10:49:34 +00:00
|
|
|
# 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/*
|
|
|
|
|
2019-05-09 10:36:30 +00:00
|
|
|
# copy to agola binaries
|
2019-05-22 10:49:34 +00:00
|
|
|
COPY --from=server_builder /agola/bin/agola /agola/bin/agola-toolbox-* /agola/bin/agola-git-hook /bin/
|
2019-05-08 13:40:11 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/bin/agola"]
|
|
|
|
|
|
|
|
|
|
|
|
#######
|
|
|
|
####### Build the demo image
|
|
|
|
#######
|
|
|
|
|
|
|
|
FROM agola as agolademo
|
|
|
|
|
|
|
|
WORKDIR /
|
|
|
|
|
2019-05-09 10:36:30 +00:00
|
|
|
# copy the example config
|
2019-05-08 15:40:07 +00:00
|
|
|
COPY examples/agolademo/config.yml .
|
2019-04-03 06:52:00 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/bin/agola"]
|