This repository was archived by the owner on Oct 2, 2023. It is now read-only.
forked from Ride-The-Lightning/RTL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (42 loc) · 1.4 KB
/
Dockerfile
File metadata and controls
59 lines (42 loc) · 1.4 KB
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
# ---------------
# Install Dependencies
# ---------------
FROM amd64/node:18-alpine as builder
WORKDIR /RTL
COPY package.json /RTL/package.json
COPY yarn.lock /RTL/yarn.lock
COPY .yarnrc.yml /RTL/.yarnrc.yml
COPY .yarn/releases/yarn-3.2.1.cjs /RTL/.yarn/releases/yarn-3.2.1.cjs
COPY .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs /RTL/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
RUN yarn
# ---------------
# Build App
# ---------------
COPY . .
# Build the Angular application
RUN yarn buildfrontend
# Build the Backend from typescript server
RUN yarn buildbackend
FROM node:18-alpine as dependencies
WORKDIR /RTL
COPY package.json /RTL/package.json
COPY yarn.lock /RTL/yarn.lock
COPY .yarnrc.yml /RTL/.yarnrc.yml
COPY .yarn/releases/yarn-3.2.1.cjs /RTL/.yarn/releases/yarn-3.2.1.cjs
COPY .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs /RTL/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
# Download only production necessary modules
RUN yarn workspaces focus --production
# ---------------
# Release App
# ---------------
FROM node:18-alpine as runner
WORKDIR /RTL
RUN apk add --no-cache tini
COPY --from=builder /RTL/rtl.js ./rtl.js
COPY --from=builder /RTL/package.json ./package.json
COPY --from=builder /RTL/frontend ./frontend
COPY --from=builder /RTL/backend ./backend
COPY --from=dependencies /RTL/node_modules/ ./node_modules
EXPOSE 3000
ENTRYPOINT ["/sbin/tini", "-g", "--"]
CMD ["node", "rtl"]