Public-Dockerfiles/swarm_visualizer_dockerfile

30 lines
No EOL
887 B
Text

FROM node:23-alpine3.20
ENV DOCKERVERSION=27.3.1
WORKDIR /usr/src/app
RUN apk --no-cache add \
curl \
unzip \
&& rm -rf /var/cache/apk/*
# https://stackoverflow.com/a/43594065
RUN curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz \
&& tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 -C /usr/local/bin docker/docker \
&& rm docker-${DOCKERVERSION}.tgz
RUN wget https://github.com/yandeu/docker-swarm-visualizer/archive/refs/heads/main.zip -O artifact.zip \
&& unzip artifact.zip -d / \
&& rm artifact.zip
RUN mv /docker-swarm-visualizer-main/package*.json /usr/src/app/ \
&& mv /docker-swarm-visualizer-main/src /usr/src/app/src \
&& mv /docker-swarm-visualizer-main/scripts /usr/src/app/scripts \
&& rm -r /docker-swarm-visualizer-main
RUN npm install --only=prod
USER node
CMD ["npm", "start"]