2018-07-20 23:07:54 +00:00
|
|
|
# ------------------------------------------------
|
|
|
|
# Builder image
|
|
|
|
# ------------------------------------------------
|
|
|
|
|
2021-01-12 23:01:17 +00:00
|
|
|
FROM ghcr.io/thumbsup/build:node-10
|
2018-07-20 23:07:54 +00:00
|
|
|
|
|
|
|
# Install thumbsup locally
|
|
|
|
WORKDIR /thumbsup
|
2018-07-25 20:35:02 +00:00
|
|
|
ARG PACKAGE_VERSION
|
|
|
|
RUN if [ -z "${PACKAGE_VERSION}" ]; then \
|
|
|
|
echo "Please specify --build-arg PACKAGE_VERSION=<2.4.1>"; \
|
|
|
|
exit 1; \
|
|
|
|
fi;
|
|
|
|
RUN echo '{"name": "installer", "version": "1.0.0"}' > package.json
|
|
|
|
RUN npm install thumbsup@${PACKAGE_VERSION}
|
2018-07-20 23:07:54 +00:00
|
|
|
|
|
|
|
# ------------------------------------------------
|
|
|
|
# Runtime image
|
|
|
|
# ------------------------------------------------
|
|
|
|
|
2021-01-12 23:01:17 +00:00
|
|
|
FROM ghcr.io/thumbsup/runtime:node-10
|
2018-07-20 23:07:54 +00:00
|
|
|
|
|
|
|
# Use tini as an init process
|
|
|
|
# to ensure all child processes (ffmpeg...) are always terminated properly
|
|
|
|
RUN apk add --update tini
|
|
|
|
ENTRYPOINT ["tini", "-g", "--"]
|
|
|
|
|
2018-08-29 19:15:52 +00:00
|
|
|
# Thumbsup can be run as any user and needs write-access to HOME
|
|
|
|
ENV HOME /tmp
|
|
|
|
|
2018-07-20 23:07:54 +00:00
|
|
|
# Copy the thumbsup files to the new image
|
|
|
|
COPY --from=build /thumbsup /thumbsup
|
|
|
|
RUN ln -s /thumbsup/node_modules/.bin/thumbsup /usr/local/bin/thumbsup
|
|
|
|
|
|
|
|
# Default command, should be overridden during <docker run>
|
|
|
|
CMD ["thumbsup"]
|