1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-28 09:33:27 +02:00

chore(server) revert Dockerfile (#878)

This commit is contained in:
Alex 2022-10-27 17:21:28 -05:00 committed by GitHub
parent b3a82b1b20
commit 676ad2d34f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 29 deletions

View File

@ -1,3 +1,4 @@
# Build stage
FROM node:16-bullseye-slim as builder
@ -7,9 +8,8 @@ WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN apt-get update > /dev/null \
&& apt-get install --no-install-recommends -y gcc g++ make cmake python3 python3-pip ffmpeg > /dev/null \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update
RUN apt-get install gcc g++ make cmake python3 python3-pip ffmpeg -y
RUN npm ci
RUN npm rebuild @tensorflow/tfjs-node --build-from-source
@ -24,9 +24,6 @@ FROM node:16-bullseye-slim
ARG DEBIAN_FRONTEND=noninteractive
COPY LICENSE /licenses/LICENSE.txt
COPY LICENSE /LICENSE
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
@ -34,18 +31,13 @@ COPY entrypoint.sh ./
RUN mkdir -p /usr/src/app/dist \
&& mkdir -p /usr/src/app/node_modules \
&& mkdir -p /usr/src/app/.reverse-geocoding-dump \
&& apt-get update > /dev/null \
&& apt-get install --no-install-recommends -y ffmpeg > /dev/null \
&& apt-get clean \
&& rm -rf /var/cache/apt/lists/*
&& apt-get update \
&& apt-get install -y ffmpeg \
&& rm -rf /var/cache/apt/lists
COPY --from=builder /usr/src/app/node_modules ./node_modules
COPY --from=builder /usr/src/app/dist ./dist
RUN npm prune --production
RUN chown -R node:0 /usr/src/app \
&& chmod -R g=u /usr/src/app
RUN addgroup node root
# CMD [ "node", "dist/main" ]

View File

@ -22,7 +22,6 @@ COPY package.json package-lock.json ./
COPY start-server.sh start-microservices.sh ./
RUN mkdir -p /usr/src/app/dist \
&& mkdir /usr/src/app/.reverse-geocoding-dump \
&& apk add --no-cache libheif vips ffmpeg
COPY --from=builder /usr/src/app/node_modules ./node_modules
@ -30,11 +29,6 @@ COPY --from=builder /usr/src/app/dist ./dist
RUN npm prune --production
RUN chown -R node:0 /usr/src/app \
&& chmod -R g=u /usr/src/app
RUN addgroup node root
VOLUME /usr/src/app/upload
EXPOSE 3001

View File

@ -6,8 +6,9 @@ COPY LICENSE /LICENSE
WORKDIR /usr/src/app
RUN chown node:node /usr/src/app && \
apk add --no-cache setpriv
RUN chown node:node /usr/src/app
RUN apk add --no-cache setpriv
COPY --chown=node:node package*.json ./
@ -15,11 +16,7 @@ RUN npm ci
COPY --chown=node:node . .
RUN npm run build \
&& chown -R node:0 /usr/src/app \
&& chmod -R g=u /usr/src/app
RUN addgroup node root
RUN npm run build
EXPOSE 3000