Skip to content

Commit

Permalink
Merge pull request #255 from amayer5125/docker-refactor
Browse files Browse the repository at this point in the history
Refactor Docs Dockerfile
  • Loading branch information
markstory authored Nov 10, 2023
2 parents d2be1f9 + 26d0193 commit 8c3f3b3
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions docs.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Generate the HTML output.
FROM ghcr.io/cakephp/docs-builder as builder

COPY docs /data/docs

ENV LANGS="en es fr ja"

WORKDIR /data/docs-builder

COPY docs /data/docs

# Build docs with sphinx
RUN cd /data/docs-builder && \
make website LANGS="$LANGS" SOURCE=/data/docs DEST=/data/website
RUN make website LANGS="$LANGS" SOURCE=/data/docs DEST=/data/website

# Build a small nginx container with just the static site in it.
FROM ghcr.io/cakephp/docs-builder:runtime as runtime
Expand All @@ -18,11 +19,7 @@ ENV SEARCH_SOURCE="/usr/share/nginx/html"
ENV SEARCH_URL_PREFIX="/authorization/3"

COPY --from=builder /data/docs /data/docs
COPY --from=builder /data/website /data/website
COPY --from=builder /data/website/html/ /usr/share/nginx/html/
COPY --from=builder /data/docs-builder/nginx.conf /etc/nginx/conf.d/default.conf

# Move files into final location
RUN cp -R /data/website/html/* /usr/share/nginx/html \
&& rm -rf /data/website/

RUN ln -s /usr/share/nginx/html /usr/share/nginx/html/2.x

0 comments on commit 8c3f3b3

Please sign in to comment.