2020-08-22 20:48:32 +02:00
|
|
|
FROM node:14.8.0-stretch
|
2020-08-22 17:33:19 +02:00
|
|
|
|
|
|
|
RUN mkdir -p /usr/src/app && \
|
|
|
|
chown node:node /usr/src/app
|
|
|
|
|
|
|
|
USER node:node
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
COPY --chown=node:node . .
|
|
|
|
|
|
|
|
RUN npm install && \
|
2020-08-22 20:48:32 +02:00
|
|
|
npm install redis@0.8.1 && \
|
|
|
|
npm install pg@4.1.1 && \
|
|
|
|
npm install memcached@2.2.2
|
2020-08-22 17:33:19 +02:00
|
|
|
|
|
|
|
ENV STORAGE_TYPE=memcached \
|
|
|
|
STORAGE_HOST=127.0.0.1 \
|
|
|
|
STORAGE_PORT=11211\
|
|
|
|
STORAGE_EXPIRE_SECONDS=2592000\
|
|
|
|
STORAGE_DB=2 \
|
|
|
|
STORAGE_CONNECTION_URL= \
|
2020-08-22 20:43:39 +02:00
|
|
|
STORAGE_AWS_BUCKET= \
|
|
|
|
STORAGE_AWS_REGION= \
|
|
|
|
STORAGE_PG_PASSWORD= \
|
|
|
|
STORAGE_PG_USERNAME=
|
2020-08-22 17:33:19 +02: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\
|
|
|
|
RATELIMITS_NORMAL_EVERY_SECONDS=60000 \
|
2020-08-22 20:43:39 +02:00
|
|
|
RATELIMITS_WHITELIST_TOTAL_REQUESTS= \
|
|
|
|
RATELIMITS_WHITELIST_EVERY_SECONDS= \
|
2020-08-22 17:33:19 +02:00
|
|
|
# comma separated list for the whitelisted \
|
2020-08-22 20:43:39 +02:00
|
|
|
RATELIMITS_WHITELIST=example1.whitelist,example2.whitelist \
|
2020-08-22 17:33:19 +02:00
|
|
|
\
|
2020-08-22 20:43:39 +02:00
|
|
|
RATELIMITS_BLACKLIST_TOTAL_REQUESTS= \
|
|
|
|
RATELIMITS_BLACKLIST_EVERY_SECONDS= \
|
2020-08-22 17:33:19 +02:00
|
|
|
# comma separated list for the blacklisted \
|
2020-08-22 20:43:39 +02:00
|
|
|
RATELIMITS_BLACKLIST=example1.blacklist,example2.blacklist
|
2020-08-22 17:33:19 +02:00
|
|
|
ENV DOCUMENTS=about=./about.md
|
|
|
|
|
2020-08-22 20:56:11 +02:00
|
|
|
EXPOSE ${PORT}
|
|
|
|
STOPSIGNAL SIGINT
|
2020-08-22 17:33:19 +02:00
|
|
|
ENTRYPOINT [ "bash", "docker-entrypoint.sh" ]
|
|
|
|
|
2020-08-22 20:56:11 +02:00
|
|
|
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s \
|
|
|
|
--retries=3 CMD [ "curl" , "-f" "localhost:${PORT}", "||", "exit", "1"]
|
2020-08-22 17:33:19 +02:00
|
|
|
CMD ["npm", "start"]
|