Skip to content

Commit 8cdaaf3

Browse files
committed
feat: make api docs visible from docker compose
1 parent 14d4608 commit 8cdaaf3

File tree

3 files changed

+36
-9
lines changed

3 files changed

+36
-9
lines changed

docs/Dockerfile

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,37 @@
1+
FROM python:3.12-slim AS builder
2+
3+
RUN apt-get update && apt-get install -y git make curl
4+
5+
COPY scripts/script-requirements.txt /scripts/script-requirements.txt
6+
COPY docs docs
7+
COPY scripts/docs/ /docs
8+
COPY gooddata-api-client /gooddata-api-client
9+
COPY gooddata-sdk /gooddata-sdk
10+
COPY gooddata-pandas /gooddata-pandas
11+
12+
RUN pip install --no-cache-dir -r /scripts/script-requirements.txt
13+
14+
WORKDIR /docs
15+
16+
RUN python json_builder.py && \
17+
python python_ref_builder.py api_spec.toml data.json latest content/en && \
18+
mkdir versioned_docs/latest && \
19+
mv -f data.json ./versioned_docs/latest/data.json && \
20+
mv -f content/en/latest/links.json ./versioned_docs/latest/links.json
21+
122
FROM node:20.18.0-bookworm-slim
223

24+
COPY --from=builder /docs /docs
25+
326
RUN apt-get update && \
427
apt-get install -y git make golang-go curl && \
528
npm install -g [email protected] && \
629
apt-get clean && \
730
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
831

9-
COPY docs docs
10-
11-
WORKDIR docs
12-
RUN npm install
32+
WORKDIR /docs
33+
RUN npm install && \
34+
hugo mod get
1335

1436
# accessible on http://localhost:1313/latest/
1537
ENTRYPOINT ["hugo", "server", "--bind", "0.0.0.0"]

docs/config/_default/params.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@
77
# - "latestTag" - docker image tag for the latest patch version. Must be changed
88
# on every patch release of respective branch
99

10+
[[versions]]
11+
version = "Latest"
12+
dirpath = "latest"
13+
url = "/latest/"
14+
productName = "Python SDK Latest"

docs/config/public/params.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# - "latestTag" - docker image tag for the latest patch version. Must be changed
88
# on every patch release of respective branch
99

10-
#[[versions]]
11-
# version = "Latest"
12-
# dirpath = "latest"
13-
# url = "/latest/"
14-
# productName = "Python SDK Latest"
10+
[[versions]]
11+
version = "Latest"
12+
dirpath = "latest"
13+
url = "/latest/"
14+
productName = "Python SDK Latest"

0 commit comments

Comments
 (0)