Files
FEDEO/backend/Dockerfile

31 lines
746 B
Docker

FROM node:20-bookworm-slim
WORKDIR /usr/src/app
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
poppler-utils \
tesseract-ocr \
tesseract-ocr-deu \
tesseract-ocr-eng \
&& rm -rf /var/lib/apt/lists/*
# Package-Dateien
COPY package*.json ./
# Dev + Prod Dependencies (für TS-Build nötig).
# Sharp benötigt im Linux-Container native optionale Pakete, auch wenn das Lockfile auf macOS erzeugt wurde.
RUN npm install --include=optional \
&& npm install --include=optional --os=linux --cpu=x64 sharp
# Restlicher Sourcecode
COPY . .
# TypeScript Build
RUN npm run build
# Port freigeben
EXPOSE 3100
# Migrationen ausführen und App starten
CMD ["sh", "./docker-entrypoint.sh"]