mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02:00
fix(server): properly handle SIGTERM (#3350)
* use tini init * Move python into CMD * Use tini as entrypoint * Toggle executable bit * Avoid compose changes * Adapt web entrypoint
This commit is contained in:
parent
6668964d92
commit
bc885f3644
@ -15,6 +15,8 @@ RUN poetry install --sync --no-interaction --no-ansi --no-root --only main
|
|||||||
|
|
||||||
FROM python:3.11.4-slim-bullseye@sha256:91d194f58f50594cda71dcd2e8fdefd90e7ecc57d07823813b67c8521e565dcd
|
FROM python:3.11.4-slim-bullseye@sha256:91d194f58f50594cda71dcd2e8fdefd90e7ecc57d07823813b67c8521e565dcd
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends tini && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
ENV NODE_ENV=production \
|
ENV NODE_ENV=production \
|
||||||
TRANSFORMERS_CACHE=/cache \
|
TRANSFORMERS_CACHE=/cache \
|
||||||
@ -25,4 +27,5 @@ ENV NODE_ENV=production \
|
|||||||
|
|
||||||
COPY --from=builder /opt/venv /opt/venv
|
COPY --from=builder /opt/venv /opt/venv
|
||||||
COPY app .
|
COPY app .
|
||||||
ENTRYPOINT ["python", "-m", "app.main"]
|
ENTRYPOINT ["tini", "--"]
|
||||||
|
CMD ["python", "-m", "app.main"]
|
||||||
|
@ -22,7 +22,7 @@ ENV NODE_ENV=production
|
|||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
RUN apk add --no-cache ffmpeg imagemagick-dev libraw-dev perl vips-dev vips-heif vips-jxl vips-magick
|
RUN apk add --no-cache ffmpeg imagemagick-dev libraw-dev perl tini vips-dev vips-heif vips-jxl vips-magick
|
||||||
|
|
||||||
COPY --from=prod /usr/src/app/node_modules ./node_modules
|
COPY --from=prod /usr/src/app/node_modules ./node_modules
|
||||||
COPY --from=prod /usr/src/app/dist ./dist
|
COPY --from=prod /usr/src/app/dist ./dist
|
||||||
@ -39,4 +39,4 @@ VOLUME /usr/src/app/upload
|
|||||||
|
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/sh"]
|
ENTRYPOINT ["tini", "--", "/bin/sh"]
|
||||||
|
@ -3,7 +3,7 @@ FROM node:18.16.0-alpine3.18@sha256:9036ddb8252ba7089c2c83eb2b0dcaf74ff1069e8ddf
|
|||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
RUN apk add --no-cache setpriv
|
RUN apk add --no-cache setpriv tini
|
||||||
|
|
||||||
FROM base as builder
|
FROM base as builder
|
||||||
|
|
||||||
@ -39,6 +39,6 @@ COPY --from=prod /usr/src/app/build ./build
|
|||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
COPY entrypoint.sh ./
|
COPY entrypoint.sh ./
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/sh"]
|
ENTRYPOINT ["tini", "--", "/bin/sh"]
|
||||||
|
|
||||||
CMD ["entrypoint.sh"]
|
CMD ["entrypoint.sh"]
|
||||||
|
0
web/entrypoint.sh
Normal file → Executable file
0
web/entrypoint.sh
Normal file → Executable file
Loading…
Reference in New Issue
Block a user