2019-09-07 03:00:00 +00:00
|
|
|
##
|
2020-10-15 16:52:41 +00:00
|
|
|
# Send
|
2019-09-07 03:00:00 +00:00
|
|
|
#
|
2020-10-15 16:52:41 +00:00
|
|
|
# License https://gitlab.com/timvisee/send/blob/master/LICENSE
|
2019-09-07 03:00:00 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
|
|
|
|
# Build project
|
2021-01-29 12:16:59 +00:00
|
|
|
FROM node:15.5.1-alpine AS builder
|
2019-09-07 03:00:00 +00:00
|
|
|
RUN set -x \
|
|
|
|
# Add user
|
|
|
|
&& addgroup --gid 10001 app \
|
|
|
|
&& adduser --disabled-password \
|
|
|
|
--gecos '' \
|
2021-01-29 12:16:59 +00:00
|
|
|
--ingroup app \
|
2019-09-07 03:00:00 +00:00
|
|
|
--home /app \
|
|
|
|
--uid 10001 \
|
|
|
|
app
|
|
|
|
COPY --chown=app:app . /app
|
|
|
|
USER app
|
2019-01-07 20:50:01 +00:00
|
|
|
WORKDIR /app
|
2019-09-07 03:00:00 +00:00
|
|
|
RUN set -x \
|
|
|
|
# Build
|
2020-07-29 21:20:39 +00:00
|
|
|
&& PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm ci \
|
2019-09-07 03:00:00 +00:00
|
|
|
&& npm run build
|
2017-06-08 23:11:17 +00:00
|
|
|
|
2019-09-07 03:00:00 +00:00
|
|
|
|
|
|
|
# Main image
|
2021-01-29 12:16:59 +00:00
|
|
|
FROM node:15.5.1-alpine
|
2019-09-07 03:00:00 +00:00
|
|
|
RUN set -x \
|
|
|
|
# Add user
|
|
|
|
&& addgroup --gid 10001 app \
|
|
|
|
&& adduser --disabled-password \
|
|
|
|
--gecos '' \
|
2021-01-29 12:16:59 +00:00
|
|
|
--ingroup app \
|
2019-09-07 03:00:00 +00:00
|
|
|
--home /app \
|
|
|
|
--uid 10001 \
|
|
|
|
app
|
2021-01-29 12:16:59 +00:00
|
|
|
|
2017-06-23 00:20:41 +00:00
|
|
|
USER app
|
2017-06-08 23:11:17 +00:00
|
|
|
WORKDIR /app
|
2019-09-07 03:00:00 +00:00
|
|
|
COPY --chown=app:app package*.json ./
|
|
|
|
COPY --chown=app:app app app
|
|
|
|
COPY --chown=app:app common common
|
|
|
|
COPY --chown=app:app public/locales public/locales
|
|
|
|
COPY --chown=app:app server server
|
|
|
|
COPY --chown=app:app --from=builder /app/dist dist
|
|
|
|
|
|
|
|
RUN npm ci --production && npm cache clean --force
|
2019-08-08 17:42:57 +00:00
|
|
|
RUN mkdir -p /app/.config/configstore
|
2019-06-03 19:25:09 +00:00
|
|
|
RUN ln -s dist/version.json version.json
|
2017-06-08 23:11:17 +00:00
|
|
|
|
2017-06-20 22:48:36 +00:00
|
|
|
ENV PORT=1443
|
2019-09-07 03:00:00 +00:00
|
|
|
|
|
|
|
EXPOSE ${PORT}
|
2017-06-20 22:48:36 +00:00
|
|
|
|
2019-01-07 20:50:01 +00:00
|
|
|
CMD ["node", "server/bin/prod.js"]
|