-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathDockerfile
39 lines (29 loc) · 997 Bytes
/
Dockerfile
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
# ==========================================
FROM registry.access.redhat.com/ubi8/nodejs-18 AS deployable
# ==========================================
WORKDIR /app
USER root
RUN curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo
RUN yum -y install yarn
# Official image has npm log verbosity as info. More info - https://github.com/nodejs/docker-node#verbosity
ENV NPM_CONFIG_LOGLEVEL warn
ARG NODE_ENV=production
ENV NODE_ENV $NODE_ENV
# Yarn
ENV YARN_VERSION 1.19.1
RUN yarn policies set-version $YARN_VERSION
# Most files from source tree are needed at runtime
COPY . /app/
RUN chown -R default:root /app
# Install npm dependencies and build the bundle
USER default
RUN yarn cache clean --force
RUN yarn
RUN yarn build
# Run the frontend server using arbitrary user to simulate
# Openshift when running using fe. Docker. Under actual
# Openshift, the user will be random
USER 158435:0
CMD [ "yarn", "start" ]
# Expose port 8086
EXPOSE 8086