Use user to launch nuxt app, use bun preset for nitro

This commit is contained in:
2025-07-07 17:48:28 +05:00
parent 976d6dba8e
commit f0458b8cf6
2 changed files with 9 additions and 1 deletions

View File

@ -12,9 +12,14 @@ RUN bun --bun run build
# Launch
FROM oven/bun:1 AS production
RUN groupadd --gid 1001 nuxt-app \
&& useradd --uid 1001 --gid nuxt-app \
--shell /bin/bash --create-home nuxt-app
USER nuxt-app:nuxt-app
WORKDIR /app
COPY --from=build /app/.output /app
EXPOSE 80/tcp
EXPOSE 3000/tcp
ENTRYPOINT [ "bun", "--bun", "run", "/app/server/index.mjs" ]

View File

@ -5,6 +5,9 @@ export default defineNuxtConfig({
compatibilityDate: '2025-05-15',
devtools: { enabled: true },
modules: ['@nuxt/eslint', '@nuxt/image', 'shadcn-nuxt', '@nuxtjs/color-mode', '@nuxt/icon'],
nitro: {
preset: 'bun',
},
colorMode: {
classSuffix: ''
},