forked from openshift-examples/web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuilder.Containerfile
30 lines (24 loc) · 992 Bytes
/
builder.Containerfile
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
# Purpose of this Containerfile is for local development / test only.
# Build: podman build --target builder -t mkdocs:local --no-cache .
# Run: podman run -ti --rm -v $(pwd):/opt/app-root/src:z -p 8080:8080 mkdocs:local
#
FROM registry.access.redhat.com/ubi9/python-39:latest AS builder
LABEL "io.openshift.s2i.build.image"="registry.access.redhat.com/ubi9/python-39:latest" \
"io.openshift.s2i.build.commit.author"="Robert Bohne <[email protected]>"
USER root
# Install gem for pre-commit
RUN dnf -y update \
&& dnf -y install gem \
&& dnf clean all
# Copying in source code
COPY requirements.txt /tmp/src/
# Change file ownership to the assemble user. Builder image must support chown command.
RUN chown -R 1001:0 /tmp/src
USER 1001
RUN /usr/libexec/s2i/assemble && rm /opt/app-root/src/requirements.txt
USER root
ADD builder.assemble /usr/libexec/s2i/assemble
USER 1001
EXPOSE 8080/tcp
WORKDIR /opt/app-root/src
CMD mkdocs serve --dev-addr 0.0.0.0:8080 --no-livereload