-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
65 lines (46 loc) · 1.71 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Install and build packages dependencies
FROM node:16-buster-slim as packages
WORKDIR /packages
COPY package.json .
COPY packages/types/package.json ./packages/types/package.json
COPY packages/shared-server/package.json ./packages/shared-server/package.json
# install package dependencies
RUN yarn
# Copy over packages files
COPY packages/types ./packages/types
COPY packages/shared-server ./packages/shared-server
# Run build
RUN npm run build:types
RUN npm run build:shared-server
FROM node:16-buster-slim as frontend-build
WORKDIR /frontend-build
COPY package.json .
COPY apps/frontend/package.json ./apps/frontend/package.json
COPY --from=packages /packages .
RUN yarn
COPY apps/frontend ./apps/frontend
COPY .eslintrc .
RUN npm run build:frontend:umbrel
FROM node:16-buster-slim as backend-build
WORKDIR /backend-build
COPY package.json .
COPY apps/express/package.json ./apps/express/package.json
COPY --from=packages /packages .
RUN yarn
COPY apps/express ./apps/express
# COPY --from=frontend-build /frontend-build/apps/frontend/build ./apps/frontend
RUN npm run build:express
FROM node:16-buster-slim as final
WORKDIR /final
COPY --from=backend-build /backend-build/apps/express/dist ./apps/express/dist
COPY --from=backend-build /backend-build/apps/express/package.json ./apps/express
COPY --from=backend-build /backend-build/node_modules ./node_modules
COPY --from=frontend-build /frontend-build/apps/frontend/build ./apps/frontend
COPY --from=packages /packages .
COPY package.json .
# Copy over HWI binary
COPY packages/HWIs/HWI_PI ./apps/express/build/HWIs/
# Intall HWI dependencies
RUN apt update && apt install libusb-1.0-0 libusb-1.0.0-dev libudev-dev python3-dev -y
EXPOSE 42069
CMD ["npm", "run", "express"]