talk-marketing-ui / Dockerfile
alymbeks's picture
initial commit
e34a5a1
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
FROM node:19 as builder-production
RUN --mount=type=secret,id=GIT_TOKEN,mode=0444,required=true \
git clone https://$(cat /run/secrets/GIT_TOKEN)@github.com/d8a-ai/talk-doc-ui.git /app
WORKDIR /app
RUN --mount=type=cache,target=/app/.npm \
npm set cache /app/.npm && \
npm ci --omit=dev
FROM builder-production as builder
RUN --mount=type=cache,target=/app/.npm \
npm set cache /app/.npm && \
npm ci
COPY --link --chown=1000 . .
RUN --mount=type=secret,id=DOTENV_LOCAL,dst=.env.local \
npm --version
RUN --mount=type=secret,id=DOTENV_LOCAL,dst=.env.local \
npm run build
FROM nikolaik/python-nodejs
RUN npm install -g pm2
RUN --mount=type=secret,id=GIT_TOKEN,mode=0444,required=true \
git clone https://$(cat /run/secrets/GIT_TOKEN)@github.com/d8a-ai/talk-doc-ui.git /app
RUN pip install -r /app/requirements.txt
COPY --from=builder-production /app/node_modules /app/node_modules
COPY --from=builder /app/build /app/build
RUN echo $(ls /app)
RUN chown 1000 /app
CMD pm2 start /app/build/index.js -i $CPU_CORES --no-daemon