2
0
mirror of https://github.com/Ride-The-Lightning/RTL synced 2024-11-11 13:10:41 +00:00
RTL/dockerfiles/Dockerfile

47 lines
932 B
Docker
Raw Normal View History

2021-12-29 23:08:41 +00:00
# ---------------
# Install Dependencies
# ---------------
FROM node:16-alpine as builder
WORKDIR /RTL
COPY package.json /RTL/package.json
COPY package-lock.json /RTL/package-lock.json
2022-12-23 01:01:49 +00:00
RUN npm install --legacy-peer-deps
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
2022-12-23 01:01:49 +00:00
RUN npm prune --production --legacy-peer-deps
2021-12-29 23:08:41 +00:00
# ---------------
# Release App
# ---------------
FROM node:16-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=builder /RTL/node_modules/ ./node_modules
EXPOSE 3000
ENTRYPOINT ["/sbin/tini", "-g", "--"]
CMD ["node", "rtl"]