Files
GTFRH/GTFRRH/project/DockerfileGTFRH.frontend
2025-10-02 12:55:40 +02:00

43 lines
833 B
Plaintext

FROM node:18
WORKDIR /GTFRRH/project
COPY package*.json ./
RUN rm -rf node_modules package-lock.json && \
npm install --include=optional
COPY . .
# Override du vite.config.ts avec allowedHosts
RUN cat > vite.config.ts << 'EOF'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
server: {
host: '0.0.0.0',
port: 3002,
strictPort: true,
allowedHosts: [
'mygtf-rh.ensup-adm.net',
'localhost',
'127.0.0.1'
],
proxy: {
'/api': {
target: 'http://backend:3000',
changeOrigin: true,
secure: false,
ws: true
}
}
}
})
EOF
EXPOSE 3002
CMD ["npm", "run", "dev"]