-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
20 lines (17 loc) · 1.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM node:18-bullseye-slim
ENV NODE_ENV=production
# follow openshfit guidelines for supporting arbitrary user IDs
# https://docs.openshift.com/container-platform/4.16/creating_images/guidelines.html#openshift-container-platform-specific-guidelines
RUN mkdir -p /usr/src/app /etc/config && \
chgrp -R 0 /usr/src/app /etc/config && \
chmod -R g=u /usr/src/app /etc/config
COPY . /usr/src/app
# make local cache folder writable by 1000 user
RUN chown -R 1000 /usr/src/app/component/node_modules/@xenova/transformers/.cache
# Reinstall onnxruntime-node based on current building platform architecture
RUN cd /usr/src/app/component/node_modules/onnxruntime-node && npm run postinstall
# Reinstall sharp based on current building platform architecture
RUN cd /usr/src/app/component/node_modules/sharp && npm run clean && node install/libvips && node install/dll-copy && node ../prebuild-install/bin.js
USER 1000
WORKDIR /usr/src/app/component
CMD [ "node", "./node_modules/fastify-cli/cli.js", "start", "-l", "info", "dist/app.js"]