refactor(dockerfile): remove old dockerfile
- delete non-tls version of dockerfile - set internal version as build-arg
This commit is contained in:
parent
d864231db1
commit
1ca3b48d0d
58
Dockerfile
58
Dockerfile
@ -1,58 +0,0 @@
|
||||
#
|
||||
# nodejs with livereload
|
||||
#
|
||||
|
||||
# allow dynamic build by specifying base image as build arg
|
||||
ARG NODE_TAG="16.4.2-alpine3.14"
|
||||
FROM node:${NODE_TAG}
|
||||
|
||||
# change user id of node user
|
||||
ARG NODE_UID=9999
|
||||
RUN deluser --remove-home node \
|
||||
&& addgroup -g ${NODE_UID} -S node \
|
||||
&& adduser -G node -S -u ${NODE_UID} node
|
||||
|
||||
# add tini, timezone support
|
||||
RUN apk --update --no-cache add tzdata tini
|
||||
|
||||
# labels
|
||||
LABEL org.opencontainers.image.authors="Asif Bacchus <asif@asifbacchus.dev>"
|
||||
LABEL org.opencontainers.image.title="livereload npm"
|
||||
LABEL org.opencontainers.image.description="Dockerized npm livereload running under limited user account. Environment variables allow specifying files to watch/exclude and notification delay."
|
||||
LABEL org.opencontainers.image.url="https://git.asifbacchus.dev/ab-docker/livereload"
|
||||
LABEL org.opencontainers.image.documentation="https://git.asifbacchus.dev/ab-docker/livereload/raw/branch/master/README.md"
|
||||
LABEL org.opencontainers.image.source="https://git.asifbacchus.dev/ab-docker/livereload.git"
|
||||
|
||||
# create default volume in case user forgets to map one
|
||||
VOLUME [ "/var/watch" ]
|
||||
|
||||
# expose port
|
||||
EXPOSE 35729
|
||||
|
||||
# default environment variables
|
||||
ENV TZ=Etc/UTC
|
||||
ENV NODE_ENV=production
|
||||
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
|
||||
ENV PATH=$PATH:/home/node/.npm-global/bin
|
||||
ENV EXT="html,xml,css,js,jsx,ts,tsx,php,py"
|
||||
ENV EXCLUDE=".git/,.svn/"
|
||||
ENV DELAY=500
|
||||
|
||||
# install livereload for node user
|
||||
USER node
|
||||
WORKDIR /home/node
|
||||
RUN mkdir -p .npm-global/bin .npm-global/lib \
|
||||
&& npm install -g livereload
|
||||
|
||||
# run node via tini by default
|
||||
ENTRYPOINT [ "/sbin/tini", "--" ]
|
||||
CMD livereload /var/watch --debug --exts $EXT --exclusions $EXCLUDE -u true --wait $DELAY
|
||||
|
||||
# set build timestamp and version labels
|
||||
ARG BUILD_DATE
|
||||
LABEL org.opencontainers.image.version="16.4.2"
|
||||
LABEL org.opencontainers.image.vendor="nodeJS"
|
||||
LABEL dev.asifbacchus.image.name="livereload npm"
|
||||
LABEL dev.asifbacchus.image.version="1.2"
|
||||
LABEL org.opencontainers.image.created=${BUILD_DATE}
|
||||
#EOF
|
@ -59,11 +59,12 @@ RUN mkdir -p .npm-global/bin .npm-global/lib \
|
||||
ENTRYPOINT [ "/sbin/tini", "--", "/usr/local/bin/entrypoint.sh" ]
|
||||
|
||||
# set build timestamp and version labels
|
||||
ARG INTERNAL_VERSION
|
||||
ARG BUILD_DATE
|
||||
LABEL org.opencontainers.image.version="16.5.0, 0.9.3"
|
||||
LABEL org.opencontainers.image.vendor="NODE.js, node-livereload"
|
||||
LABEL dev.asifbacchus.image.name="livereload-tls-npm"
|
||||
LABEL dev.asifbacchus.image.version="2.0"
|
||||
LABEL dev.asifbacchus.image.version=${INTERNAL_VERSION}
|
||||
LABEL org.opencontainers.image.created=${BUILD_DATE}
|
||||
|
||||
#EOF
|
||||
|
Loading…
Reference in New Issue
Block a user