2022-05-27 13:04:54 +00:00
|
|
|
FROM node:16-slim as base
|
2020-08-22 15:33:19 +00:00
|
|
|
|
2022-05-27 13:04:54 +00:00
|
|
|
ARG user
|
|
|
|
RUN mkdir /app && chown -R $user:$user /app
|
|
|
|
USER $user
|
|
|
|
WORKDIR /app
|
2020-08-22 15:33:19 +00:00
|
|
|
|
2022-05-27 13:04:54 +00:00
|
|
|
COPY --chown=$user:$user package.json yarn.lock /app/
|
|
|
|
RUN yarn install
|
2020-08-22 15:33:19 +00:00
|
|
|
|
2022-05-27 13:04:54 +00:00
|
|
|
COPY --chown=$user:$user . /app
|
2020-08-22 15:33:19 +00:00
|
|
|
|
|
|
|
ENV STORAGE_TYPE=memcached \
|
|
|
|
STORAGE_HOST=127.0.0.1 \
|
|
|
|
STORAGE_PORT=11211\
|
|
|
|
STORAGE_EXPIRE_SECONDS=2592000\
|
|
|
|
STORAGE_DB=2 \
|
2020-08-22 18:43:39 +00:00
|
|
|
STORAGE_AWS_BUCKET= \
|
|
|
|
STORAGE_AWS_REGION= \
|
2021-10-07 03:40:46 +00:00
|
|
|
STORAGE_USENAME= \
|
2020-08-22 19:56:58 +00:00
|
|
|
STORAGE_PASSWORD= \
|
2021-07-14 09:00:42 +00:00
|
|
|
STORAGE_FILEPATH=
|
2020-08-22 15:33:19 +00:00
|
|
|
|
|
|
|
ENV LOGGING_LEVEL=verbose \
|
|
|
|
LOGGING_TYPE=Console \
|
|
|
|
LOGGING_COLORIZE=true
|
|
|
|
|
|
|
|
ENV HOST=0.0.0.0\
|
|
|
|
PORT=7777\
|
|
|
|
KEY_LENGTH=10\
|
|
|
|
MAX_LENGTH=400000\
|
|
|
|
STATIC_MAX_AGE=86400\
|
|
|
|
RECOMPRESS_STATIC_ASSETS=true
|
|
|
|
|
|
|
|
ENV KEYGENERATOR_TYPE=phonetic \
|
|
|
|
KEYGENERATOR_KEYSPACE=
|
|
|
|
|
|
|
|
ENV RATELIMITS_NORMAL_TOTAL_REQUESTS=500\
|
2020-08-22 20:12:54 +00:00
|
|
|
RATELIMITS_NORMAL_EVERY_MILLISECONDS=60000 \
|
2020-08-22 18:43:39 +00:00
|
|
|
RATELIMITS_WHITELIST_TOTAL_REQUESTS= \
|
2020-08-22 20:12:54 +00:00
|
|
|
RATELIMITS_WHITELIST_EVERY_MILLISECONDS= \
|
2020-08-22 15:33:19 +00:00
|
|
|
# comma separated list for the whitelisted \
|
2020-08-22 18:43:39 +00:00
|
|
|
RATELIMITS_WHITELIST=example1.whitelist,example2.whitelist \
|
2021-07-14 09:00:42 +00:00
|
|
|
\
|
2020-08-22 18:43:39 +00:00
|
|
|
RATELIMITS_BLACKLIST_TOTAL_REQUESTS= \
|
2020-08-22 20:12:54 +00:00
|
|
|
RATELIMITS_BLACKLIST_EVERY_MILLISECONDS= \
|
2020-08-22 15:33:19 +00:00
|
|
|
# comma separated list for the blacklisted \
|
2021-07-14 09:00:42 +00:00
|
|
|
RATELIMITS_BLACKLIST=example1.blacklist,example2.blacklist
|
2020-08-22 15:33:19 +00:00
|
|
|
ENV DOCUMENTS=about=./about.md
|
|
|
|
|
2020-08-22 18:56:11 +00:00
|
|
|
EXPOSE ${PORT}
|
|
|
|
STOPSIGNAL SIGINT
|
2020-08-22 15:33:19 +00:00
|
|
|
ENTRYPOINT [ "bash", "docker-entrypoint.sh" ]
|
|
|
|
|
2022-05-27 13:04:54 +00:00
|
|
|
RUN yarn build
|
|
|
|
COPY static /app/dist/static
|
|
|
|
|
2020-08-22 18:56:11 +00:00
|
|
|
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s \
|
2021-09-10 05:02:26 +00:00
|
|
|
--retries=3 CMD [ "sh", "-c", "echo -n 'curl localhost:7777... '; \
|
|
|
|
(\
|
2022-05-27 13:04:54 +00:00
|
|
|
curl -sf localhost:7777 > /dev/null\
|
2021-09-10 05:02:26 +00:00
|
|
|
) && echo OK || (\
|
2022-05-27 13:04:54 +00:00
|
|
|
echo Fail && exit 2\
|
2021-09-10 05:02:26 +00:00
|
|
|
)"]
|
2022-05-27 13:04:54 +00:00
|
|
|
|
|
|
|
CMD ["yarn", "start"]
|