From eb194c2c5b6dc4ebc1b2fa1b80e1a3bce7261391 Mon Sep 17 00:00:00 2001 From: Vivek Rawat Date: Sun, 13 Oct 2024 22:34:46 +0530 Subject: [PATCH] dockerfile dockerignore file added (#884) --- .dockerignore | 6 ++++++ Dockerfile | 23 +++++++++++++++++++++++ vite.config.js | 4 ++++ 3 files changed, 33 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..a598ead8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +node_modules +npm-debug.log +dist +.git +.gitignore + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..fab05eee --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM node:18-alpine AS builder + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +RUN npm run build + +FROM node:18-alpine AS runner + +WORKDIR /app + +COPY --from=builder /app ./ + +RUN npm install + +EXPOSE 5173 + +CMD ["npm", "run", "dev"] diff --git a/vite.config.js b/vite.config.js index 5a33944a..57244615 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,4 +4,8 @@ import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + server: { + host: true, + port: 5173, + }, })