agola/Dockerfile

61 lines
1004 B
Docker
Raw Normal View History

2019-02-21 15:10:30 +00:00
#######
####### Build the backend
#######
# 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
# 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
# copy all the source
2019-02-21 15:10:30 +00:00
COPY . .
# 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
#######
FROM debian:stable AS agola
2019-02-21 15:10:30 +00:00
WORKDIR /
2019-02-21 15:10:30 +00:00
# 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 /
# Install git needed by gitserver
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
# copy the example config
COPY examples/agolademo/config.yml .
ENTRYPOINT ["/bin/agola"]