85258
continuous-integration/drone/push Build is passing Details

master
37b7 3 weeks ago
parent 8e59d2ceb8
commit ddba0f7a1d

@ -1,6 +1,11 @@
FROM node:18-alpine as builder FROM node:18-alpine as builder
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
ENV NODE_ENV=production
ENV BASE_PATH=/containers/matheothierry-portfolio_nuxt
ENV CDN_URL=https://codefirst.iut.uca.fr
ENV HOST=0.0.0.0
ENV PORT=3000
RUN npm install RUN npm install
COPY . . COPY . .
RUN npm run build RUN npm run build
@ -14,6 +19,7 @@ COPY --from=builder /app/.nuxt ./.nuxt
RUN npm install --production RUN npm install --production
ENV NODE_ENV=production ENV NODE_ENV=production
ENV BASE_PATH=/containers/matheothierry-portfolio_nuxt ENV BASE_PATH=/containers/matheothierry-portfolio_nuxt
ENV CDN_URL=https://codefirst.iut.uca.fr
ENV HOST=0.0.0.0 ENV HOST=0.0.0.0
ENV PORT=3000 ENV PORT=3000

@ -29,16 +29,17 @@ export default defineNuxtConfig({
} }
], ],
}, },
baseURL:'/containers/matheothierry-portfolio_nuxt/', baseURL: process.env.NODE_ENV === 'production' ? process.env.BASE_PATH : '/',
buildAssetsDir: '/_nuxt/', buildAssetsDir: '/_nuxt/',
cdnURL: 'https://codefirst.iut.uca.fr/' cdnURL: process.env.NODE_ENV === 'production' ? process.env.CDN_URL : '',
}, },
modules: ['@nuxt/image'], modules: ['@nuxt/image'],
plugins: [ plugins: [
{ src: 'plugins/router.ts', mode: 'server' }, { src: 'plugins/router.ts', mode: 'server' },
{ src: 'plugins/theme.ts', mode: 'client' } { src: 'plugins/theme.ts', mode: 'client' },
{ src: 'plugins/prevent-redirection.client.ts', mode: 'server' }
], ],
image: { image: {
@ -64,7 +65,7 @@ export default defineNuxtConfig({
runtimeConfig: { runtimeConfig: {
public: { public: {
basePath: process.env.NODE_ENV === 'production' ? '/containers/matheothierry-portfolio_nuxt/' : '/' basePath: process.env.NODE_ENV === 'production' ? process.env.BASE_PATH : '/'
} }
} }
}) })

@ -0,0 +1,6 @@
export default defineNuxtPlugin({
order: -40,
setup: (nuxtApp) => {
delete nuxtApp.payload.path
}
})
Loading…
Cancel
Save