Skip to content

Commit e33e5ee

Browse files
author
Meer Sawood
authored
chore: Migrate RHEL image to ubi (#249)
* update dockerfile * change build step * added webpack config
1 parent 628402c commit e33e5ee

3 files changed

Lines changed: 241 additions & 260 deletions

File tree

Dockerfile.rhel

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,16 @@
1-
# base image sources https://github.com/rhdt/EL-Dockerfiles/tree/master/base/fabric8-analytics-stack-report-ui
2-
FROM registry.access.redhat.com/ubi8/nodejs-14:latest AS builder
3-
USER 0
4-
WORKDIR /tmp/src
5-
RUN chown -R 1001:0 /tmp/src/
6-
ADD package.json /tmp/src/
7-
ADD package-lock.json /tmp/src/
8-
USER 1001
9-
RUN npm install phantomjs-prebuilt@2.1.14 --ignore-scripts
10-
RUN npm install
11-
ENV PATH="./tmp/src/node_modules/.bin:$PATH"
1+
FROM registry.access.redhat.com/ubi8/ubi-minimal
2+
3+
RUN microdnf module enable nodejs:14
4+
RUN microdnf install nodejs
5+
RUN microdnf install httpd
6+
RUN sed -i 's/Listen 80/Listen 80\nServerName localhost\nListen 8080/' /etc/httpd/conf/httpd.conf
127
ADD . /tmp/src/
13-
# Requires root user to build a production build
8+
WORKDIR /tmp/src
149
USER root
15-
# Create A production build
16-
RUN npm run build:prod
17-
18-
19-
FROM quay.io/app-sre/rhel-base-fabric8-analytics-stack-report-ui:latest
20-
21-
RUN mkdir -p /opt/scripts /var/www/html
22-
23-
COPY --from=builder /tmp/src/dist /var/www/html/
24-
# ADD dist /var/www/html/
25-
26-
ADD ./passwd.template ./run.sh /opt/scripts/
27-
28-
RUN chmod -R 777 /opt/scripts/run.sh
29-
10+
RUN npm install phantomjs-prebuilt@2.1.14 --ignore-scripts
11+
RUN npm install
12+
RUN npm run build:produbi
3013
WORKDIR /var/www/html
31-
32-
EXPOSE 8080 8443
33-
34-
USER apache
35-
36-
ENTRYPOINT ["/opt/scripts/run.sh"]
37-
38-
CMD ["apache"]
14+
EXPOSE 80 8080 8443
15+
CMD ["-D", "FOREGROUND"]
16+
ENTRYPOINT ["/usr/sbin/httpd"]

0 commit comments

Comments
 (0)