-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (22 loc) · 679 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (22 loc) · 679 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
FROM node:18 AS builder
WORKDIR /usr/src/app
# Add package files and install dependencies
# Its important to copy in package files first to avoid caching issues
COPY frontend/package.json ./
RUN npm i
# Copy rest of the project and build
COPY frontend/ .
RUN npm run build
FROM node:14-alpine
LABEL org.opencontainers.image.source=https://github.com/Danielv123/serverManager
# Open a port in the firewall
EXPOSE 8080
RUN apk add ipmitool
WORKDIR /usr/src/app
COPY backend/package.json ./
RUN npm i --only=production
# Copy rest of the backend
COPY backend/src ./src
# Copy our frontend build result
COPY --from=builder /usr/src/app/build build
CMD [ "npm", "start" ]