Update Dockerfile

This commit is contained in:
xbdm 2023-09-17 07:48:30 -04:00 committed by GitHub
parent 80fb93be44
commit f9f2585722
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,14 @@
FROM crystallang/crystal:1.8.2-alpine AS builder FROM crystallang/crystal:1.8.2-alpine AS builder
RUN apk add --no-cache sqlite-static yaml-static RUN apk add --no-cache sqlite-static yaml-static
ARG release ARG release
WORKDIR /invidious WORKDIR /invidious
COPY ./shard.yml ./shard.yml COPY ./shard.yml ./shard.yml
COPY ./shard.lock ./shard.lock COPY ./shard.lock ./shard.lock
RUN shards install --production RUN shards install --production
COPY ./src/ ./src/ COPY ./src/ ./src/
# TODO: .git folder is required for building this is destructive. # TODO: .git folder is required for building this is destructive.
# See definition of CURRENT_BRANCH, CURRENT_COMMIT and CURRENT_VERSION. # See definition of CURRENT_BRANCH, CURRENT_COMMIT and CURRENT_VERSION.
@ -26,6 +30,8 @@ RUN if [[ "${release}" == 1 ]] ; then \
--link-flags "-lxml2 -llzma"; \ --link-flags "-lxml2 -llzma"; \
fi fi
FROM alpine:3.18 FROM alpine:3.18
RUN apk add --no-cache librsvg ttf-opensans tini RUN apk add --no-cache librsvg ttf-opensans tini
WORKDIR /invidious WORKDIR /invidious
@ -39,6 +45,7 @@ COPY ./locales/ ./locales/
COPY --from=builder /invidious/assets ./assets/ COPY --from=builder /invidious/assets ./assets/
COPY --from=builder /invidious/invidious . COPY --from=builder /invidious/invidious .
RUN chmod o+rX -R ./assets ./config ./locales RUN chmod o+rX -R ./assets ./config ./locales
EXPOSE 3000 EXPOSE 3000
USER invidious USER invidious
ENTRYPOINT ["/sbin/tini", "--"] ENTRYPOINT ["/sbin/tini", "--"]