mirror of
https://github.com/immich-app/immich.git
synced 2024-12-26 10:50:29 +02:00
2dcccb37a0
* default NODE_ENV to production for server image * update node image to use 3.17 alpine in server * update web docker image to use alpine 3.17 * remove NODE_ENV from production docker-compose * NODE_ENV is also needed default in machine-learning
42 lines
767 B
Docker
42 lines
767 B
Docker
FROM node:16-alpine3.17 as builder
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
RUN apk add --update-cache build-base python3 libheif vips-dev ffmpeg perl
|
|
|
|
COPY package.json package-lock.json ./
|
|
|
|
RUN npm ci
|
|
|
|
COPY . .
|
|
|
|
|
|
FROM builder as prod
|
|
|
|
RUN npm run build
|
|
RUN npm prune --omit=dev --omit=optional
|
|
|
|
|
|
FROM node:16-alpine3.17
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
RUN apk add --no-cache libheif vips ffmpeg perl
|
|
|
|
COPY --from=prod /usr/src/app/node_modules ./node_modules
|
|
COPY --from=prod /usr/src/app/dist ./dist
|
|
COPY --from=prod /usr/src/app/bin ./bin
|
|
|
|
COPY LICENSE /licenses/LICENSE.txt
|
|
COPY LICENSE /LICENSE
|
|
COPY package.json package-lock.json ./
|
|
COPY start-server.sh start-microservices.sh ./
|
|
|
|
RUN npm link && npm cache clean --force
|
|
|
|
VOLUME /usr/src/app/upload
|
|
|
|
EXPOSE 3001
|