Spaces:
Sleeping
Sleeping
Commit
•
9011efd
1
Parent(s):
3b2e3db
modifie script
Browse files- Dockerfile +2 -0
- next.config.js +1 -1
Dockerfile
CHANGED
@@ -19,6 +19,7 @@ RUN --mount=type=secret,id=AUTH_SECRET \
|
|
19 |
AUTH_SECRET="$(cat /run/secrets/AUTH_SECRET)" \
|
20 |
OPENAI_API_KEY="$(cat /run/secrets/OPENAI_API_KEY)" \
|
21 |
NEXT_SHARP_PATH="/app/node_modules/sharp" \
|
|
|
22 |
pnpm run build
|
23 |
|
24 |
RUN mkdir -p /app/.next/cache/images
|
@@ -33,6 +34,7 @@ COPY --from=builder --link /app/public ./public
|
|
33 |
|
34 |
# Automatically leverage output traces to reduce image size
|
35 |
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
|
|
36 |
COPY --from=builder --link --chown=1000:1000 /app/.next/standalone ./
|
37 |
COPY --from=builder --link --chown=1000:1000 /app/.next/static ./.next/static
|
38 |
COPY --from=builder --link --chown=1000:1000 /app/.next/cache/images ./.next/cache/images
|
|
|
19 |
AUTH_SECRET="$(cat /run/secrets/AUTH_SECRET)" \
|
20 |
OPENAI_API_KEY="$(cat /run/secrets/OPENAI_API_KEY)" \
|
21 |
NEXT_SHARP_PATH="/app/node_modules/sharp" \
|
22 |
+
USE_STANDALONE_BUILD=True \
|
23 |
pnpm run build
|
24 |
|
25 |
RUN mkdir -p /app/.next/cache/images
|
|
|
34 |
|
35 |
# Automatically leverage output traces to reduce image size
|
36 |
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
37 |
+
COPY --chown=nextjs:nodejs --from=builder /app/ ./
|
38 |
COPY --from=builder --link --chown=1000:1000 /app/.next/standalone ./
|
39 |
COPY --from=builder --link --chown=1000:1000 /app/.next/static ./.next/static
|
40 |
COPY --from=builder --link --chown=1000:1000 /app/.next/cache/images ./.next/cache/images
|
next.config.js
CHANGED
@@ -12,5 +12,5 @@ module.exports = {
|
|
12 |
experimental: {
|
13 |
serverComponentsExternalPackages: ['pino', 'pino-loki'],
|
14 |
},
|
15 |
-
output: 'standalone',
|
16 |
};
|
|
|
12 |
experimental: {
|
13 |
serverComponentsExternalPackages: ['pino', 'pino-loki'],
|
14 |
},
|
15 |
+
...(process.env.USE_STANDALONE_BUILD ? { output: 'standalone' } : {}),
|
16 |
};
|