forked from RedHatInsights/payload-tracker-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (35 loc) · 1.43 KB
/
Dockerfile
File metadata and controls
49 lines (35 loc) · 1.43 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
WORKDIR /usr/src/app
ARG SERVICE_HOST
ENV API_HOST=${SERVICE_HOST:+$SERVICE_HOST}
ENV API_HOST=${SERVICE_HOST:-localhost}
ENV NODEJS_VERSION=22
USER 0
RUN microdnf update && microdnf module enable nginx:1.22 && microdnf install nginx
RUN INSTALL_PKGS="nodejs nodejs-nodemon nodejs-full-i18n npm findutils tar which" && \
microdnf -y module disable nodejs && \
microdnf -y module enable nodejs:$NODEJS_VERSION && \
microdnf --nodocs --setopt=install_weak_deps=0 install $INSTALL_PKGS && \
node -v | grep -qe "^v$NODEJS_VERSION\." && echo "Found VERSION $NODEJS_VERSION" && \
microdnf clean all && \
rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.*
COPY package.json package-lock.json ./
RUN npm ci && npm i --only=dev && npm install yarn
COPY src ./src
COPY .babelrc ./.babelrc
COPY *.js ./
RUN npm run build && \
rm -rfv /usr/share/nginx/html && \
cp -rfv /usr/src/app/dist /usr/share/nginx/html && \
chown nginx:nginx -R /usr/share/nginx/html && \
mkdir -p /var/cache/nginx && \
chmod 777 -R /var/log/nginx && \
chmod 777 -R /var/cache/nginx
# This file is not used in openshift, but is in the image
# in the event it is used for local development
COPY nginx.conf /etc/nginx/nginx.conf
RUN sed -i s/API_HOST/$API_HOST/g /etc/nginx/nginx.conf
EXPOSE 8080
STOPSIGNAL SIGTERM
USER 100
CMD ["nginx", "-g", "daemon off;"]