Spaces:
Sleeping
Sleeping
Commit
·
faa59e7
1
Parent(s):
d446a2d
Update Dockerfile
Browse files- Dockerfile +9 -3
Dockerfile
CHANGED
@@ -1,10 +1,16 @@
|
|
1 |
FROM node:18 AS base
|
2 |
|
3 |
-
#
|
4 |
-
FROM base AS deps
|
5 |
-
|
6 |
WORKDIR /app
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
# Install dependencies based on the preferred package manager
|
9 |
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
|
10 |
RUN \
|
|
|
1 |
FROM node:18 AS base
|
2 |
|
3 |
+
# Create app directory and set it as WORKDIR
|
|
|
|
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
# Create the cache directory with the correct permissions before switching to the node user
|
7 |
+
USER root
|
8 |
+
RUN mkdir -p /app/node_modules/@xenova/transformers/.cache && \
|
9 |
+
chown -R node:node /app/node_modules
|
10 |
+
|
11 |
+
# Switch to the node user for installing dependencies
|
12 |
+
USER node
|
13 |
+
|
14 |
# Install dependencies based on the preferred package manager
|
15 |
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
|
16 |
RUN \
|