Skip to content

Commit 2f70c56

Browse files
BAP-22982: Move all the builds from regular to dev_container build in the master branch (Documentation) (#40932)
* BAP-22982: Move all the builds from regular to dev_container build in the master branch - Add Documentation to dev_container. Updated app config - Removed documentation from the regular build --------- Co-authored-by: Viacheslav Dubrovskyi <[email protected]>
1 parent 5834c5c commit 2f70c56

File tree

5 files changed

+78
-6
lines changed

5 files changed

+78
-6
lines changed

.env-build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ORO_IMAGE=${ORO_PROJECT}doc-application

Dockerfile

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
FROM sphinxdoc/sphinx:7.1.2
1+
FROM sphinxdoc/sphinx:7.1.2 AS build
22

3-
RUN apt-get -y update
4-
RUN apt-get -y install git
3+
RUN apt-get -y update && \
4+
apt-get -y install git && \
5+
apt-get clean
56

67
WORKDIR /documentation
7-
ADD requirements.txt /documentation
8-
RUN pip3 install -r requirements.txt
8+
9+
COPY . .
10+
11+
RUN pip3 install -r requirements.txt
12+
13+
RUN rm -rf _build/html && sphinx-build -T -W --keep-going -j auto -b html . _build/html
14+
15+
FROM scratch AS build_artifacts
16+
WORKDIR /
17+
COPY --from=build /documentation/_build/ .
18+
19+
FROM nginx:stable-alpine-slim AS runtime
20+
21+
LABEL org.opencontainers.image.title="Oro Documentation" \
22+
org.opencontainers.image.description="Docker image for building and serving Sphinx documentation" \
23+
org.opencontainers.image.authors="ORO Inc." \
24+
org.opencontainers.image.vendor="ORO Inc."
25+
26+
COPY --from=build /documentation/_build/html /usr/share/nginx/html

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,18 @@ Documentation is published at https://doc.oroinc.com/.
66

77
For the recommendations on how to setup your local environment to build documentation and how to use reStructuredText markup language to write documentation, follow the community guide on the [Oro Inc documentation website](https://doc.oroinc.com/master/community/contribute/documentation/):
88

9+
## Build
10+
11+
```
12+
docker buildx bake --progress plain --load
13+
```
14+
15+
As a result, an image and a ./_build folder will be created where the built documentation will be located.
16+
17+
## Check
18+
19+
The image can be launched as an instance and opened in a browser.
20+
21+
```
22+
docker run --rm -p 80:80 ocir.eu-frankfurt-1.oci.oraclecloud.com/frecfpcrj6gd/oro-product-development/doc-application:latest
23+
```

docker-bake.hcl

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
variable "ORO_PROJECT" { default = "ocir.eu-frankfurt-1.oci.oraclecloud.com/frecfpcrj6gd/oro-product-development/" }
2+
variable "ORO_IMAGE" { default = "${ORO_PROJECT}doc-application" }
3+
variable "ORO_IMAGE_TAG" { default = "latest" }
4+
variable "GIT_COMMIT" { default = null }
5+
variable "GIT_URL" { default = null }
6+
variable "BUILD_TIMESTAMP" { default = null }
7+
variable "GIT_BRANCH" { default = null }
8+
variable "TAG_NAME" { default = null }
9+
10+
function "labelList" {
11+
params = []
12+
result = {
13+
"org.opencontainers.image.revision" = "${GIT_COMMIT}"
14+
"org.opencontainers.image.source" = "${GIT_URL}"
15+
"org.opencontainers.image.created" = "${BUILD_TIMESTAMP}"
16+
"com.oroinc.orocloud.reference" = "${GIT_BRANCH}"
17+
"org.opencontainers.image.version" = "${TAG_NAME}"
18+
}
19+
}
20+
21+
group "default" {
22+
targets = ["runtime", "build_artifacts"]
23+
}
24+
25+
target "runtime" {
26+
target = "runtime"
27+
dockerfile = "Dockerfile"
28+
tags = [
29+
"${ORO_IMAGE}:${ORO_IMAGE_TAG}",
30+
"${ORO_IMAGE}:${formatdate("YYYYMMDD", timestamp())}"
31+
]
32+
labels = labelList()
33+
}
34+
35+
target "build_artifacts" {
36+
target = "build_artifacts"
37+
dockerfile = "Dockerfile"
38+
output = ["type=local, dest=./_build"]
39+
}

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3.5'
21
services:
32
doc:
43
image: oroinc/documentation:sphinx-7.1.2

0 commit comments

Comments
 (0)