burtenshaw commited on
Commit
de75e72
·
1 Parent(s): 67e67c5

using mout typr

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -3
Dockerfile CHANGED
@@ -14,13 +14,14 @@ RUN npm ci
14
 
15
  # Build stage
16
  FROM base AS builder
17
-
18
  # Copy dependencies from the 'deps' stage
19
  COPY --from=deps /app/node_modules ./node_modules
20
  # Copy the rest of the application code
21
  COPY . .
22
- # Build the SvelteKit application, attempting to read the secret directly
23
- RUN HF_TOKEN=$(cat /run/secrets/HF_TOKEN) npm run build
 
 
24
 
25
  # Production stage
26
  FROM base AS production
 
14
 
15
  # Build stage
16
  FROM base AS builder
 
17
  # Copy dependencies from the 'deps' stage
18
  COPY --from=deps /app/node_modules ./node_modules
19
  # Copy the rest of the application code
20
  COPY . .
21
+ # Build the SvelteKit application, mounting the secret and reading it with cat
22
+ # The secret 'HF_TOKEN' must be defined in the Hugging Face Space settings
23
+ RUN --mount=type=secret,id=HF_TOKEN \
24
+ HF_TOKEN=$(cat /run/secrets/HF_TOKEN) npm run build
25
 
26
  # Production stage
27
  FROM base AS production