1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-24 08:52:28 +02:00
immich/web/Dockerfile
Zack Pollard 43da8c2a72
chore: reduce docker image size (#1523)
* chore: remove @tensorflow/tfjs-node-gpu as it is unused

* chore: remove ffmpeg from machine-learning docker image

* chore: remove unneeded dependencies + move dev dependencies in server

* chore: reduce server image size

* chore: machine-learning remove extraneous dependencies

* chore: web remove extraneous dependencies

* chore: web Dockerfile reduce production image size

* chore: add exiftool-vendored.pl as a dependency
2023-02-02 21:28:34 -06:00

41 lines
647 B
Docker

# Our Node base image
FROM node:16-alpine3.14 as base
WORKDIR /usr/src/app
EXPOSE 3000
RUN apk add --no-cache setpriv
FROM base as builder
RUN chown node:node /usr/src/app
COPY --chown=node:node package*.json ./
RUN npm ci
COPY --chown=node:node . .
EXPOSE 3000
FROM builder AS dev
ENV CHOKIDAR_USEPOLLING=true
EXPOSE 24678
CMD ["npm", "run", "dev"]
FROM builder AS prod
RUN npm run build
RUN npm prune --omit=dev
FROM base
ENV NODE_ENV=production
WORKDIR /usr/src/app
COPY --from=prod /usr/src/app/node_modules ./node_modules
COPY --from=prod /usr/src/app/build ./build
COPY package.json package-lock.json ./
COPY entrypoint.sh ./