2023-06-03 09:17:03 +00:00
|
|
|
FROM node:20
|
2020-12-16 01:53:29 +00:00
|
|
|
|
2021-02-26 06:20:41 +00:00
|
|
|
ARG TINI_VER="v0.19.0"
|
2020-12-16 01:53:29 +00:00
|
|
|
|
2021-02-26 06:20:41 +00:00
|
|
|
# install tini
|
|
|
|
ADD https://github.com/krallin/tini/releases/download/$TINI_VER/tini /sbin/tini
|
|
|
|
RUN chmod +x /sbin/tini
|
2020-12-16 01:53:29 +00:00
|
|
|
|
2021-02-26 06:20:41 +00:00
|
|
|
# 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/*
|
2020-12-16 01:53:29 +00:00
|
|
|
|
2021-02-26 06:20:41 +00:00
|
|
|
# copy minetrack files
|
|
|
|
WORKDIR /usr/src/minetrack
|
2020-12-16 01:53:29 +00:00
|
|
|
COPY . .
|
2021-02-26 06:20:41 +00:00
|
|
|
|
|
|
|
# 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
|
2020-12-16 01:53:29 +00:00
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
2021-02-26 06:20:41 +00:00
|
|
|
ENTRYPOINT ["/sbin/tini", "--", "node", "main.js"]
|