2018-06-19 19:53:18 -04:00
|
|
|
FROM jc21/node
|
2017-12-20 18:02:37 -05:00
|
|
|
|
2018-04-15 22:10:12 -04:00
|
|
|
MAINTAINER Jamie Curnow <jc@jc21.com>
|
|
|
|
LABEL maintainer="Jamie Curnow <jc@jc21.com>"
|
|
|
|
|
2017-12-20 18:02:37 -05:00
|
|
|
ENV SUPPRESS_NO_CONFIG_WARNING=1
|
|
|
|
ENV S6_FIX_ATTRS_HIDDEN=1
|
|
|
|
RUN echo "fs.file-max = 65535" > /etc/sysctl.conf
|
|
|
|
|
2018-06-19 19:53:18 -04:00
|
|
|
# Nginx, letsencrypt and other packages
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install --no-install-recommends --no-install-suggests -y curl ca-certificates apt-transport-https \
|
|
|
|
&& apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg \
|
2018-07-26 02:22:40 -04:00
|
|
|
&& apt-key adv --fetch-keys http://nginx.org/keys/nginx_signing.key \
|
|
|
|
&& echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" > /etc/apt/sources.list.d/nginx.list \
|
2018-06-19 19:53:18 -04:00
|
|
|
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
|
|
|
|
&& echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get install --no-install-recommends --no-install-suggests -y \
|
2018-07-26 02:22:40 -04:00
|
|
|
gnupg openssl dirmngr apt-transport-https wget \
|
|
|
|
inetutils-ping build-essential apache2-utils yarn nginx \
|
2018-06-19 20:19:53 -04:00
|
|
|
&& apt-get install --no-install-recommends --no-install-suggests -y certbot letsencrypt -t jessie-backports \
|
2018-06-19 19:53:18 -04:00
|
|
|
&& apt-get clean
|
|
|
|
|
2017-12-20 18:02:37 -05:00
|
|
|
# root filesystem
|
|
|
|
COPY rootfs /
|
|
|
|
|
|
|
|
# s6 overlay
|
2018-05-07 18:30:33 -04:00
|
|
|
RUN curl -L -o /tmp/s6-overlay-amd64.tar.gz "https://github.com/just-containers/s6-overlay/releases/download/v1.21.4.0/s6-overlay-amd64.tar.gz" \
|
2017-12-20 18:02:37 -05:00
|
|
|
&& tar xzf /tmp/s6-overlay-amd64.tar.gz -C /
|
|
|
|
|
|
|
|
# App
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
2018-06-19 19:53:18 -04:00
|
|
|
ADD dist /srv/app/dist
|
|
|
|
ADD node_modules /srv/app/node_modules
|
|
|
|
ADD src/backend /srv/app/src/backend
|
|
|
|
ADD package.json /srv/app/package.json
|
2018-07-26 02:42:07 -04:00
|
|
|
ADD knexfile.js /srv/app/knexfile.js
|
2017-12-20 18:02:37 -05:00
|
|
|
|
|
|
|
# Volumes
|
2018-06-19 19:53:18 -04:00
|
|
|
VOLUME [ "/data", "/etc/letsencrypt" ]
|
2017-12-20 18:02:37 -05:00
|
|
|
CMD [ "/init" ]
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=15s --timeout=3s CMD curl -f http://localhost:9876/health || exit 1
|