Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Dockerfile.master - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 900e654e7321295ea5ea796027021d9bc2ac8fe6 (plain)
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
# First use the bootstrap image to build master
FROM registry.gitlab.com/gitlab-com/gitlab-docs:bootstrap as builder

# Build the docs from this branch
COPY . /source/
RUN bundle exec rake setup_git default
RUN bundle exec nanoc compile -VV

# Remove tmp dir to save some space
RUN rm -rf /source/tmp

# BUILD OF MASTER DOCS IS NOW DONE!

# Reset to alpine so we don't get any docs source or extra apps
FROM nginx:1.12-alpine

ENV TARGET=/usr/share/nginx/html

# Get the nginx config from the nginx-onbuild image
# This hardly ever changes so should usually be cached
COPY --from=registry.gitlab.com/gitlab-com/gitlab-docs:nginx-onbuild /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf

RUN rm -rf /usr/share/nginx/html/*

# Get all the archive static HTML and put it into place
# Go oldest-to-newest to take advantage of the fact that we change older
# archives less often than new ones. Copy the versions found in
# 'content/_data/versions.yaml' under current and previous.
COPY --from=registry.gitlab.com/gitlab-com/gitlab-docs:10.6 ${TARGET} ${TARGET}
COPY --from=registry.gitlab.com/gitlab-com/gitlab-docs:10.7 ${TARGET} ${TARGET}
COPY --from=registry.gitlab.com/gitlab-com/gitlab-docs:10.8 ${TARGET} ${TARGET}

# Get the built docs output from the previous build stage
# This ordering means all previous layers can come from cache unless an archive
# changes
COPY --from=builder /source/public ${TARGET}

# Serve the site (target), which is now all static HTML
CMD echo -e "GitLab docs are viewable at:\nhttp://0.0.0.0:4000"; exec nginx -g 'daemon off;'