-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
39 lines (28 loc) · 945 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 public.ecr.aws/docker/library/node:16-slim as appbase
# ===============================================
WORKDIR /app
# Copy package.json and package-lock.json/yarn.lock files
COPY package*.json ./
# Install dependencies
RUN npm install
# =============================
FROM appbase as development
# =============================
# Copy all files
COPY . .
CMD ["npm", "start"]
#==============================
FROM appbase as staticbuilder
#==============================
COPY . /app
RUN npm run build
# ============================================================
FROM registry.access.redhat.com/ubi8/nginx-120 as production
# =============================================================
# Copy static build
COPY --from=staticbuilder /app/build /usr/share/nginx/html
# Copy nginx config
COPY ./.prod/nginx.conf /etc/nginx/nginx.conf
EXPOSE 8000
CMD ["nginx", "-g", "daemon off;"]