bitb0x/roles/apps/templates/rtl/Containerfile.j2
b0xxer 36a67e91c0 added aliases for pmls / pmlsa
added basic rtl container (not configured yet)
2024-02-15 07:56:39 -06:00

49 lines
1.0 KiB
Django/Jinja

# Install Dependencies
# ---------------
FROM docker.io/almalinux/9-base as builder
WORKDIR /RTL
RUN dnf update -y \
&& dnf module -y enable nodejs:18 \
&& dnf install -y nodejs git \
&& git clone https://github.com/Ride-The-Lightning/RTL.git . \
&& git checkout tags/v0.15.0 \
&& npm install
# ---------------
# Build App
# ---------------
# Build the Angular application
RUN npm run buildfrontend
# Build the Backend from typescript server
RUN npm run buildbackend
# Remove non production necessary modules
RUN npm prune --production
# ---------------
# Release App
# ---------------
FROM docker.io/almalinux/9-init
RUN dnf update -y \
&& dnf module -y enable nodejs:18 \
&& dnf install -y nodejs \
&& dnf clean all \
&& rm -fr /tmp/*
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
EXPOSE 3000
CMD ["node", "rtl"]