Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

341
Vistas
Vue3, Vite, Docker - Vite cant find files on docker build (and also netlify)

EDIT: I also try to deploy my app via netlify and I get the same error.

My Dockerfile - for the sake of this. The root of my project is called app

# build stage
FROM node:14.15.5 as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
    
# production stage
FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"

My vite.config.js

import { fileURLToPath, URL } from 'url';

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    host: true,
    port: 8080,
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
      '~@': fileURLToPath(new URL('./src', import.meta.url)),
    },
  },
});

The error I get

> [build-stage 6/6] RUN npm run build:                                                                                                                                                  
#14 0.596 
#14 0.596 > app@0.0.1 build /app#14 0.596 > vite build
#14 0.596 
#14 0.846 vite v2.9.9 building for production...
#14 1.015 transforming...
#14 3.220 ✓ 51 modules transformed.
#14 3.221 [vite:css] ENOENT: no such file or directory, open '/app/src/assets/fonts/Shentox-light.ttf'
#14 3.221 file: /app/src/App.vue?vue&type=style&index=0&scoped=true&lang.css
#14 3.221 error during build:
#14 3.221 Error: ENOENT: no such file or directory, open '/app/src/assets/fonts/Shentox-light.ttf'

When I run npm run build without docker it works. Any insights?

Thanks -Coffee

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda