Files

33 lines
709 B
Docker
Raw Permalink Normal View History

# sudo docker compose up -d --build
FROM node:20-bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libreoffice-writer \
fonts-noto-cjk \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
RUN if [ -d fonts ] && ls fonts/*.{ttf,otf,ttc} 2>/dev/null | grep -q .; then \
mkdir -p /usr/local/share/fonts/custom && \
cp fonts/*.ttf fonts/*.otf fonts/*.ttc /usr/local/share/fonts/custom/ 2>/dev/null || true && \
fc-cache -f; \
fi
ENV NODE_ENV=production
ENV PORT=3001
ENV TEMPLATE_DIR=/app/templates
ENV TEMP_DIR=/tmp/rental-contracts
ENV SOFFICE_BIN=soffice
EXPOSE 3001
CMD ["npm", "start"]