-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Migrate RHEL image to ubi (#249)
* update dockerfile * change build step * added webpack config
- Loading branch information
Meer Sawood
authored
Dec 17, 2021
1 parent
628402c
commit e33e5ee
Showing
3 changed files
with
241 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,16 @@ | ||
# base image sources https://github.com/rhdt/EL-Dockerfiles/tree/master/base/fabric8-analytics-stack-report-ui | ||
FROM registry.access.redhat.com/ubi8/nodejs-14:latest AS builder | ||
USER 0 | ||
WORKDIR /tmp/src | ||
RUN chown -R 1001:0 /tmp/src/ | ||
ADD package.json /tmp/src/ | ||
ADD package-lock.json /tmp/src/ | ||
USER 1001 | ||
RUN npm install [email protected] --ignore-scripts | ||
RUN npm install | ||
ENV PATH="./tmp/src/node_modules/.bin:$PATH" | ||
FROM registry.access.redhat.com/ubi8/ubi-minimal | ||
|
||
RUN microdnf module enable nodejs:14 | ||
RUN microdnf install nodejs | ||
RUN microdnf install httpd | ||
RUN sed -i 's/Listen 80/Listen 80\nServerName localhost\nListen 8080/' /etc/httpd/conf/httpd.conf | ||
ADD . /tmp/src/ | ||
# Requires root user to build a production build | ||
WORKDIR /tmp/src | ||
USER root | ||
# Create A production build | ||
RUN npm run build:prod | ||
|
||
|
||
FROM quay.io/app-sre/rhel-base-fabric8-analytics-stack-report-ui:latest | ||
|
||
RUN mkdir -p /opt/scripts /var/www/html | ||
|
||
COPY --from=builder /tmp/src/dist /var/www/html/ | ||
# ADD dist /var/www/html/ | ||
|
||
ADD ./passwd.template ./run.sh /opt/scripts/ | ||
|
||
RUN chmod -R 777 /opt/scripts/run.sh | ||
|
||
RUN npm install [email protected] --ignore-scripts | ||
RUN npm install | ||
RUN npm run build:produbi | ||
WORKDIR /var/www/html | ||
|
||
EXPOSE 8080 8443 | ||
|
||
USER apache | ||
|
||
ENTRYPOINT ["/opt/scripts/run.sh"] | ||
|
||
CMD ["apache"] | ||
EXPOSE 80 8080 8443 | ||
CMD ["-D", "FOREGROUND"] | ||
ENTRYPOINT ["/usr/sbin/httpd"] |
Oops, something went wrong.