GTFRH_V1
This commit is contained in:
42
GTFRRH/project/DockerfileGTFRH.frontend
Normal file
42
GTFRRH/project/DockerfileGTFRH.frontend
Normal file
@@ -0,0 +1,42 @@
|
||||
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"]
|
||||
Reference in New Issue
Block a user