2020-02-18 23:55:06 -05:00
|
|
|
# This is a Dockerfile intended to be built using `docker buildx`
|
|
|
|
# for multi-arch support. Building with `docker build` may have unexpected results.
|
|
|
|
|
|
|
|
# This file assumes that the frontend has been built using ./scripts/frontend-build
|
|
|
|
|
2020-05-27 19:25:29 -04:00
|
|
|
FROM --platform=${TARGETPLATFORM:-linux/amd64} jc21/alpine-nginx-full:node
|
2020-02-18 23:55:06 -05:00
|
|
|
|
2020-02-20 19:52:43 -05:00
|
|
|
ARG TARGETPLATFORM
|
|
|
|
ARG BUILDPLATFORM
|
2020-02-18 23:55:06 -05:00
|
|
|
ARG BUILD_VERSION
|
|
|
|
ARG BUILD_COMMIT
|
|
|
|
ARG BUILD_DATE
|
|
|
|
|
|
|
|
ENV SUPPRESS_NO_CONFIG_WARNING=1
|
|
|
|
ENV S6_FIX_ATTRS_HIDDEN=1
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
|
|
|
RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \
|
|
|
|
&& apk update \
|
2020-10-04 19:04:18 -04:00
|
|
|
&& apk add python3 certbot jq \
|
|
|
|
&& python3 -m ensurepip \
|
2020-02-18 23:55:06 -05:00
|
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
|
|
|
|
ENV NPM_BUILD_VERSION="${BUILD_VERSION}" NPM_BUILD_COMMIT="${BUILD_COMMIT}" NPM_BUILD_DATE="${BUILD_DATE}"
|
|
|
|
|
|
|
|
# s6 overlay
|
2020-02-20 19:52:43 -05:00
|
|
|
COPY scripts/install-s6 /tmp/install-s6
|
|
|
|
RUN /tmp/install-s6 "${TARGETPLATFORM}" && rm -f /tmp/install-s6
|
2020-02-18 23:55:06 -05:00
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
EXPOSE 81
|
|
|
|
EXPOSE 443
|
|
|
|
|
|
|
|
COPY docker/rootfs /
|
|
|
|
ADD backend /app
|
|
|
|
ADD frontend/dist /app/frontend
|
2020-10-06 10:12:12 -04:00
|
|
|
COPY global /app/global
|
2020-02-18 23:55:06 -05:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
RUN yarn install
|
|
|
|
|
|
|
|
# Remove frontend service not required for prod, dev nginx config as well
|
|
|
|
RUN rm -rf /etc/services.d/frontend RUN rm -f /etc/nginx/conf.d/dev.conf
|
|
|
|
|
|
|
|
VOLUME [ "/data", "/etc/letsencrypt" ]
|
|
|
|
CMD [ "/init" ]
|
|
|
|
|
2020-02-20 19:52:43 -05:00
|
|
|
HEALTHCHECK --interval=5s --timeout=3s CMD /bin/check-health
|