2021-12-29 23:08:41 +00:00
|
|
|
# ---------------
|
|
|
|
# Install Dependencies
|
|
|
|
# ---------------
|
2023-12-07 02:59:04 +00:00
|
|
|
FROM node:18-alpine as builder
|
2021-12-29 23:08:41 +00:00
|
|
|
|
|
|
|
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-static-armel /tini
|
|
|
|
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-static-armel.asc /tini.asc
|
|
|
|
RUN chmod +x /tini
|
|
|
|
|
|
|
|
WORKDIR /RTL
|
|
|
|
|
|
|
|
COPY package.json /RTL/package.json
|
|
|
|
COPY package-lock.json /RTL/package-lock.json
|
|
|
|
|
2023-12-07 02:59:04 +00:00
|
|
|
RUN npm install
|
2021-12-29 23:08:41 +00:00
|
|
|
|
|
|
|
# ---------------
|
|
|
|
# Build App
|
|
|
|
# ---------------
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# Build the Angular application
|
|
|
|
RUN npm run buildfrontend
|
|
|
|
|
|
|
|
# Build the Backend from typescript server
|
|
|
|
RUN npm run buildbackend
|
|
|
|
|
|
|
|
# Remove non production necessary modules
|
2023-12-07 02:59:04 +00:00
|
|
|
RUN npm prune --production
|
2021-12-29 23:08:41 +00:00
|
|
|
|
|
|
|
# ---------------
|
|
|
|
# Release App
|
|
|
|
# ---------------
|
2023-12-07 02:59:04 +00:00
|
|
|
FROM arm32v7/node:18-alpine as runner
|
2021-12-29 23:08:41 +00:00
|
|
|
|
|
|
|
WORKDIR /RTL
|
|
|
|
|
|
|
|
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=builder /RTL/node_modules/ ./node_modules
|
|
|
|
COPY --from=builder "/tini" /sbin/tini
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
ENTRYPOINT ["/sbin/tini", "-g", "--"]
|
|
|
|
|
|
|
|
CMD ["node", "rtl"]
|