Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

343
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!