mirror of
https://github.com/immich-app/immich.git
synced 2025-01-06 03:46:47 +01:00
5db73c5c5c
* Use base image for server build * Clean up build scripts * target tags for base image * use prod tag instead of runtime * use runtime stage for dev --------- Co-authored-by: mertalev <101130780+mertalev@users.noreply.github.com> Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
32 lines
655 B
Docker
32 lines
655 B
Docker
FROM ghcr.io/immich-app/base-server-dev:20231109 as builder
|
|
|
|
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 ghcr.io/immich-app/base-server-prod:20231109
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
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*.sh ./
|
|
|
|
RUN npm link && npm cache clean --force
|
|
VOLUME /usr/src/app/upload
|
|
|
|
EXPOSE 3001
|
|
|
|
ENTRYPOINT ["tini", "--", "/bin/sh"]
|