-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
43 lines (31 loc) · 1.01 KB
/
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
40
41
42
43
# ===============================================
FROM public.ecr.aws/docker/library/node:18.20.4-slim as appbase
# ===============================================
# Yarn
ENV YARN_VERSION 1.22.22
RUN yarn policies set-version $YARN_VERSION
WORKDIR /app
# Copy package.json and package-lock.json/yarn.lock files
COPY package*.json *yarn* ./
# Install dependencies
RUN yarn install
# =============================
FROM appbase as development
# =============================
# Copy all files
COPY . .
CMD ["yarn", "start"]
#==============================
FROM appbase as staticbuilder
#==============================
COPY . /app
RUN yarn build
# ============================================================
FROM registry.access.redhat.com/ubi8/nginx-118 as production
# =============================================================
# Copy static build
COPY --from=staticbuilder /app/build /usr/share/nginx/html
# Copy nginx config
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
EXPOSE 8000
CMD ["nginx", "-g", "daemon off;"]