|
|
@ -1,8 +1,4 @@ |
|
|
FROM ghcr.io/vikashloomba/capmvm-k8s-os:1.23.5 |
|
|
FROM docker.io/library/node:18-alpine AS build_node_modules |
|
|
RUN apt-get install -y unzip |
|
|
|
|
|
RUN curl -fsSL https://fnm.vercel.app/install | bash |
|
|
|
|
|
RUN /bin/bash -c "source ~/.bashrc \ |
|
|
|
|
|
&& fnm use --install-if-missing 20" |
|
|
|
|
|
|
|
|
|
|
|
# Update npm to latest |
|
|
# Update npm to latest |
|
|
RUN npm install -g npm@latest |
|
|
RUN npm install -g npm@latest |
|
|
@ -10,6 +6,26 @@ RUN npm install -g npm@latest |
|
|
# Copy Web UI |
|
|
# Copy Web UI |
|
|
COPY src /app |
|
|
COPY src /app |
|
|
WORKDIR /app |
|
|
WORKDIR /app |
|
|
RUN npm ci --omit=dev |
|
|
RUN npm ci --omit=dev &&\ |
|
|
# Set Environment |
|
|
mv node_modules /node_modules |
|
|
ENV DEBUG=Server,WireGuard |
|
|
|
|
|
|
|
|
# Copy build result to a new image. |
|
|
|
|
|
# This saves a lot of disk space. |
|
|
|
|
|
FROM ghcr.io/vikashloomba/capmvm-k8s-os:1.23.5 |
|
|
|
|
|
HEALTHCHECK CMD /usr/bin/timeout 5s /bin/sh -c "/usr/bin/wg show | /bin/grep -q interface || exit 1" --interval=1m --timeout=5s --retries=3 |
|
|
|
|
|
COPY --from=build_node_modules /app /app |
|
|
|
|
|
|
|
|
|
|
|
# Move node_modules one directory up, so during development |
|
|
|
|
|
# we don't have to mount it in a volume. |
|
|
|
|
|
# This results in much faster reloading! |
|
|
|
|
|
# |
|
|
|
|
|
# Also, some node_modules might be native, and |
|
|
|
|
|
# the architecture & OS of your development machine might differ |
|
|
|
|
|
# than what runs inside of docker. |
|
|
|
|
|
COPY --from=build_node_modules /node_modules /node_modules |
|
|
|
|
|
|
|
|
|
|
|
# Copy the needed wg-password scripts |
|
|
|
|
|
COPY --from=build_node_modules /app/wgpw.sh /bin/wgpw |
|
|
|
|
|
|
|
|
|
|
|
# Update npm to latest |
|
|
|
|
|
RUN npm install -g npm@latest |
|
|
|