Minetrack/Dockerfile
nothub 7a76c8b45d
docker (#225)
* docker

* port

* duplicate ignore

* readme

* dockerignore whitelist
(yes .dockerignore has to be explicitly ignored in .dockerignore)

* write perms in app dir
2021-02-26 00:20:41 -06:00

33 lines
918 B
Docker

FROM node:15
ARG TINI_VER="v0.19.0"
# install tini
ADD https://github.com/krallin/tini/releases/download/$TINI_VER/tini /sbin/tini
RUN chmod +x /sbin/tini
# install sqlite3
RUN apt-get update \
&& apt-get install --quiet --yes --no-install-recommends sqlite3 \
&& apt-get clean --quiet --yes \
&& apt-get autoremove --quiet --yes \
&& rm -rf /var/lib/apt/lists/*
# copy minetrack files
WORKDIR /usr/src/minetrack
COPY . .
# build minetrack
RUN npm install --build-from-source \
&& npm run build
# run as non root
RUN addgroup --gid 10043 --system minetrack \
&& adduser --uid 10042 --system --ingroup minetrack --no-create-home --gecos "" minetrack \
&& chown -R minetrack:minetrack /usr/src/minetrack
USER minetrack
EXPOSE 8080
ENTRYPOINT ["/sbin/tini", "--", "node", "main.js"]