-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrontend.Dockerfile
More file actions
49 lines (31 loc) · 953 Bytes
/
frontend.Dockerfile
File metadata and controls
49 lines (31 loc) · 953 Bytes
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
49
# Install Dependencies
FROM node:18.12.0 AS Dependencies
WORKDIR /app
COPY package*.json ./
RUN npm ci --force
# End of Install Dependencies
# ---------------------------------------------------------
# Run Testing
# FROM node:18.12.0 AS Testing
# WORKDIR /app
# COPY --from=Dependencies /app/node_modules ./node_modules
# COPY . .
# RUN CI=true npm run test -b
# End of Tests
# ---------------------------------------------------------
# Build App
FROM node:18.12.0 AS Build
WORKDIR /app
COPY --from=Dependencies /app/node_modules ./node_modules
COPY . .
RUN npm run build
# Remove Not needed Dependencies in node_modules Folder
# RUN npm ci --omit=dev --force && npm cache clean --force
# End of Building
# ---------------------------------------------------------
# Move App To Final Image
FROM nginx:latest AS Final
COPY nginx.conf /etc/nginx/conf.d
COPY --from=Build /app/build /usr/share/nginx/html
EXPOSE 80
# End of Final Image