2019-09-07 05:00:00 +02:00
|
|
|
##
|
2020-10-15 18:52:41 +02:00
|
|
|
# Send
|
2019-09-07 05:00:00 +02:00
|
|
|
#
|
2020-10-15 18:52:41 +02:00
|
|
|
# License https://gitlab.com/timvisee/send/blob/master/LICENSE
|
2019-09-07 05:00:00 +02:00
|
|
|
##
|
|
|
|
|
|
|
|
# Build project
|
2021-12-01 18:20:43 +01:00
|
|
|
FROM node:16.13-alpine3.13 AS builder
|
2022-03-26 16:08:24 +01:00
|
|
|
|
|
|
|
RUN set -x \
|
|
|
|
# Change node uid/gid
|
|
|
|
&& apk --no-cache add shadow \
|
|
|
|
&& groupmod -g 1001 node \
|
|
|
|
&& usermod -u 1001 -g 1001 node
|
|
|
|
|
2019-09-07 05:00:00 +02:00
|
|
|
RUN set -x \
|
|
|
|
# Add user
|
2022-03-26 16:08:24 +01:00
|
|
|
&& addgroup --gid 1000 app \
|
2019-09-07 05:00:00 +02:00
|
|
|
&& adduser --disabled-password \
|
|
|
|
--gecos '' \
|
2021-01-29 13:16:59 +01:00
|
|
|
--ingroup app \
|
2019-09-07 05:00:00 +02:00
|
|
|
--home /app \
|
2022-03-26 16:08:24 +01:00
|
|
|
--uid 1000 \
|
2019-09-07 05:00:00 +02:00
|
|
|
app
|
2022-03-26 16:08:24 +01:00
|
|
|
|
2019-09-07 05:00:00 +02:00
|
|
|
COPY --chown=app:app . /app
|
2022-03-26 16:08:24 +01:00
|
|
|
|
2019-09-07 05:00:00 +02:00
|
|
|
USER app
|
2019-01-07 21:50:01 +01:00
|
|
|
WORKDIR /app
|
2022-03-26 16:08:24 +01:00
|
|
|
|
2019-09-07 05:00:00 +02:00
|
|
|
RUN set -x \
|
|
|
|
# Build
|
2020-07-29 23:20:39 +02:00
|
|
|
&& PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm ci \
|
2019-09-07 05:00:00 +02:00
|
|
|
&& npm run build
|
2017-06-09 01:11:17 +02:00
|
|
|
|
2019-09-07 05:00:00 +02:00
|
|
|
# Main image
|
2021-12-01 18:20:43 +01:00
|
|
|
FROM node:16.13-alpine3.13
|
2022-03-26 16:08:24 +01:00
|
|
|
|
|
|
|
RUN set -x \
|
|
|
|
# Change node uid/gid
|
|
|
|
&& apk --no-cache add shadow \
|
|
|
|
&& groupmod -g 1001 node \
|
|
|
|
&& usermod -u 1001 -g 1001 node
|
|
|
|
|
2019-09-07 05:00:00 +02:00
|
|
|
RUN set -x \
|
|
|
|
# Add user
|
2022-03-26 16:08:24 +01:00
|
|
|
&& addgroup --gid 1000 app \
|
2019-09-07 05:00:00 +02:00
|
|
|
&& adduser --disabled-password \
|
|
|
|
--gecos '' \
|
2021-01-29 13:16:59 +01:00
|
|
|
--ingroup app \
|
2019-09-07 05:00:00 +02:00
|
|
|
--home /app \
|
2022-03-26 16:08:24 +01:00
|
|
|
--uid 1000 \
|
2019-09-07 05:00:00 +02:00
|
|
|
app
|
2021-01-29 13:16:59 +01:00
|
|
|
|
2017-06-23 02:20:41 +02:00
|
|
|
USER app
|
2017-06-09 01:11:17 +02:00
|
|
|
WORKDIR /app
|
2022-03-26 16:08:24 +01:00
|
|
|
|
2019-09-07 05:00:00 +02: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-06-03 21:25:09 +02:00
|
|
|
RUN ln -s dist/version.json version.json
|
2017-06-09 01:11:17 +02:00
|
|
|
|
2017-06-21 00:48:36 +02:00
|
|
|
ENV PORT=1443
|
2019-09-07 05:00:00 +02:00
|
|
|
|
|
|
|
EXPOSE ${PORT}
|
2017-06-21 00:48:36 +02:00
|
|
|
|
2019-01-07 21:50:01 +01:00
|
|
|
CMD ["node", "server/bin/prod.js"]
|