FROM node:10-buster-slim

########################################
# APT local cache
# work around because COPY failed if no source file
COPY .dummy .apt-mirror-confi[g] .proxy-confi[g] /
RUN cp /.proxy-config /etc/profile.d/proxy.sh 2> /dev/null || true
RUN if [ -f /.apt-mirror-config ] ; then . /.apt-mirror-config && sed -i \
	-e "s%s\?://deb.debian.org%://${APT_MIRROR_DEBIAN}%g" \
	-e "s%s\?://security.debian.org%://${APT_MIRROR_DEBIAN_SECURITY}%g" \
	-e "s%s\?://archive.ubuntu.com%://${APT_MIRROR_UBUNTU}%g" \
	-e "s%s\?://security.ubuntu.com%://${APT_MIRROR_UBUNTU_SECURITY}%g" \
	/etc/apt/sources.list; fi

########################################
WORKDIR /quota
COPY dockers/quotas/html/ .
EXPOSE 3000
WORKDIR /quota/express_webapp
RUN npm install --no-audit
CMD ["npm","start"]
